IAudioEngine

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

see

http://doc.babylonjs.com/how_to/playing_sounds_and_music

Hierarchy

Implemented by

Index

Properties

WarnedWebAudioUnsupported

Find examples in Playground
WarnedWebAudioUnsupported: boolean

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

ignorenaming

audioContext

Find examples in Playground
audioContext: Nullable<AudioContext>

Gets the current AudioContext if available.

canUseWebAudio

Find examples in Playground
canUseWebAudio: boolean

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

isMP3supported

Find examples in Playground
isMP3supported: boolean

Gets whether or not mp3 are supported by your browser.

isOGGsupported

Find examples in Playground
isOGGsupported: boolean

Gets whether or not ogg are supported by your browser.

masterGain

Find examples in Playground
masterGain: GainNode

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

onAudioLockedObservable

Find examples in Playground
onAudioLockedObservable: Observable<AudioEngine>

Event raised when audio has been locked on the browser.

onAudioUnlockedObservable

Find examples in Playground
onAudioUnlockedObservable: Observable<AudioEngine>

Event raised when audio has been unlocked on the browser.

unlocked

Find examples in Playground
unlocked: boolean

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

useCustomUnlockedButton

Find examples in Playground
useCustomUnlockedButton: boolean

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

Methods

dispose

Find examples in Playground
  • dispose(): void

lock

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

    Returns void

unlock

Find examples in Playground
  • 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

Generated using TypeDoc