• Public
  • Public/Protected
  • All

This represents an audio engine and it is responsible to play, synchronize and analyse sounds throughout the application.




Implemented by



WarnedWebAudioUnsupported: boolean

Defines if Babylon should emit a warning if WebAudio is not supported.

audioContext: Nullable<AudioContext>

Gets the current AudioContext if available.

canUseWebAudio: boolean

Gets whether the current host supports Web Audio and thus could create AudioContexts.

isMP3supported: boolean

Gets whether or not mp3 are supported by your browser.

isOGGsupported: boolean

Gets whether or not ogg are supported by your browser.

masterGain: GainNode

The master gain node defines the global audio volume of your audio engine.

onAudioLockedObservable: Observable<IAudioEngine>

Event raised when audio has been locked on the browser.

onAudioUnlockedObservable: Observable<IAudioEngine>

Event raised when audio has been unlocked on the browser.

unlocked: boolean

Gets whether or not the audio engine is unlocked (require first a user gesture on some browser).

useCustomUnlockedButton: boolean

Defines if the audio engine relies on a custom unlocked button. In this case, the embedded button will not be displayed.


  • connectToAnalyser(analyser: Analyser): void
  • dispose(): void
  • Releases all held resources

    Returns void

  • getGlobalVolume(): number
  • Gets the global volume sets on the master gain.

    Returns number

    the global volume if set or -1 otherwise

  • lock(): void
  • Flags the audio engine in Locked state. This happens due to new browser policies preventing audio to autoplay.

    Returns void

  • setGlobalVolume(newVolume: number): void
  • Sets the global volume of your experience (sets on the master gain).


    • newVolume: number

      Defines the new global volume of the application

    Returns void

  • unlock(): void
  • Unlocks the audio engine once a user action has been done on the dom. This is helpful to resume play once browser policies have been satisfied.

    Returns void


  • Constructor
  • Property
  • Method
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Property
  • Method
  • Static method