Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AudioMixer

Create a virtual mixing-console with audio channels

Hierarchy

  • AudioMixer

Index

Constructors

  • new AudioMixer(audioContext?: AudioContext): AudioMixer
  • Create a new AudioMixer instance.

    example

    Standard JavaScript

    const mixer = new muses.AudioMixer( ) ;
    
    example

    TypeScript

    const mixer : AudioMixer = new AudioMixer( ) ;
    

    Parameters

    • Optional audioContext: AudioContext

    Returns AudioMixer

Properties

audioContext: AudioContext

The audio-context instance used to process audio (same as "ctx" property).

channels: AudioChannel[] = []

All channels added to the current AudioMixer instance

ctx: AudioContext

The audio-context instance used to process audio.

inputNode: GainNode

The node to control the mixer output volume

Accessors

  • get volume(): number
  • set volume(value: number): void
  • Get the current volume value of the mixer

    Returns number

  • Modify the volume of the current mixer (from 0 to 1)

    Parameters

    • value: number

    Returns void

Methods

  • Add a new channel in the current AudioMixer.

    Parameters

    • Optional id: string

    Returns AudioChannel

  • Look for a channel with a specific id.

    Parameters

    • id: string

      The previous defined id on the addChannel( ) method call.

    Returns null | AudioChannel

  • resumeContext(): string
  • Due to the constant change in browser security, it is necessary to wait for the user to perform an action within the web page in order to execute the AudioContext correctly. If necessary, you can execute this method once the user executes the action in order to allow access to the AudioContext. Basically, this method verify and executes another funtion inside the AudioContext object, AudioContext.resume().

    see

    https://goo.gl/7K7WLu - For more details about auto-play policy.

    Returns string

    • AudioContext status.

Generated using TypeDoc