Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WaveShaper

export

Hierarchy

  • WaveShaper

Index

Constructors

constructor

Accessors

activeWaveShapers

  • get activeWaveShapers(): string[]
  • description

    Active id's, redraws when draw is called without argument

    readonly
    unused
    memberof

    WaveShaper

    Returns string[]

duration

  • get duration(): number
  • description

    Total duration of all tracks

    readonly
    memberof

    WaveShaper

    Returns number

lastProcessResult

options

Methods

clearTracks

  • description

    Removes the waves and all callbacks with given id from the manager

    Parameters

    • Rest ...ids: string[]

    Returns WaveShaper

    WaveShaper instance

emitSegment

flatten

  • description

    Flattens the segments of the given waveshaper id

    Parameters

    • Default value ids: string[] = []

    Returns WaveShaper

    WaveShaper instance

getTrack

  • getTrack(id: string): Track | undefined
  • description

    Gets Track with given id

    Parameters

    • id: string

    Returns Track | undefined

    Track with given ID

off

offOptions

offSegment

on

  • Registers a callback that fires when the track with given id is processed

    Parameters

    • id: string

      id of Track to register to

    • callBack: WaveShaperCallback

      will be invoked when the given track is processed

    Returns WaveShaper

    WaveShaper instance

onOptions

onSegment

positionToTime

  • positionToTime(position: number): number
  • Gives the time corresponding to a given position

    Parameters

    • position: number

    Returns number

process

  • process(ids?: string[], start?: number, width?: number, shift?: number): WaveShaper
  • Processes all relevant WaveShapers and invokes registered callbacks

    Parameters

    • Default value ids: string[] = []

      Options array of id's to draw

    • Default value start: number = 0

      Start position

    • Default value width: number = this.options.width

      Width to process

    • Default value shift: number = 0

      Units to shift current data

    Returns WaveShaper

    WaveShaper instance

setActive

  • description

    The given id's are set as the active waveshapers, process only processes these when set, call with no values to allways process all values (default)

    Parameters

    • Rest ...ids: string[]

      Waveshaper id's to set as active

    Returns WaveShaper

    WaveShaper instance

setData

  • setData(...data: Data[]): this
  • description

    Adds audio data to the waveshaper and redraws waveshapers using it

    Parameters

    • Rest ...data: Data[]

      AudioBuffer with audio data

    Returns this

    WaveShaper instance

setOptions

  • description

    Merges the given options into the current and returns updated options

    Parameters

    Returns WaveShaper

    WaveShaper instance

setTracks

timeToPosition

  • timeToPosition(time: number): number
  • Gives the position corresponding to a given time

    Parameters

    • time: number

    Returns number

Generated using TypeDoc