Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Playback

Playback node which can load and playback audio from a given url

Hierarchy

Index

Constructors

Properties

Accessors

Other Methods

Utility Methods

Constructors

constructor

Properties

analyser

analyser: Analyser

Euphony analyser for visualization

Readonly input

input: null

Underlying WebAudio node used for input to the Euphony node

Readonly output

output: AudioNode

Underlying WebAudio node used for output from the Euphony node

Accessors

duration

  • get duration(): number
  • Returns the duration in seconds of the underlying audio buffer

    Returns number

length

  • get length(): number
  • Returns the length of the underlying audio buffer

    Returns number

loop

  • get loop(): boolean
  • set loop(value: boolean): void
  • Controls weather the playback should loop after finishing or not

    Returns boolean

  • Controls weather the playback should loop after finishing or not

    Parameters

    • value: boolean

    Returns void

volume

  • get volume(): number
  • set volume(volume: number): void
  • Volume of the controller, scale 0.0 to 1.0

    Returns number

  • Volume of the controller, scale 0.0 to 1.0

    Parameters

    • volume: number

    Returns void

Other Methods

getPlaybackTime

  • getPlaybackTime(): number
  • Returns the current playback position of the audio in seconds

    Returns number

load

  • load(url: string, callbacks?: Callbacks): Promise<void>
  • Loads audio from the given url into the audio node

    Parameters

    • url: string

      Url to load the audio data from (Can be local or external)

    • callbacks: Callbacks = {}

      Callback functions to be used be the loader

    Returns Promise<void>

pause

  • pause(delay?: number): void
  • Shcedules the audio to be paused, playback can then be resumed by calling Playback.play

    Note: It is recommended to allow some amount of scheduling time to prevent audio glitches

    Parameters

    • delay: number = 0.1

      Amount of time in seconds before the audio is paused

    Returns void

play

  • play(delay?: number): void
  • Shcedules the audio to be played

    Note: It is recommended to allow some amount of scheduling time to prevent audio glitches

    Parameters

    • delay: number = 0.1

      Amount of time in seconds before the audio begins playback

    Returns void

stop

  • stop(delay?: number): void
  • Shcedules the audio playback to be stopped. If played again by calling Playback.play the previous time will not be remembered

    Note: It is recommended to allow some amount of scheduling time to prevent audio glitches

    Parameters

    • delay: number = 0.1

      Amount of time in seconds before the audio is stopped

    Returns void

Utility Methods

connect

  • Function for connecting a Euphony node to another Euphony node or a WebAudio node

    Parameters

    • destination: EuphonyNode | AudioNode

      The destionation to connect to, either a Euphony node or base WebAudio node

    Returns void

Generated using TypeDoc