InterfaceAudio System@public
FlxAudioBackend
Replaceable audio backend. The browser implementation wraps Web Audio API; the null implementation enables headless testing.
ts
export interface FlxAudioBackendProperties
| Property | Modifiers | Type | Description |
|---|---|---|---|
suspended | readonly | boolean | - |
unlocked | readonly | boolean | - |
Methods
createSound()
ts
createSound(source: unknown, streaming: boolean): FlxSoundHandleCreate a sound handle.
Parameters:
| Parameter | Type | Description |
|---|---|---|
source | unknown | decoded AudioBuffer, URL string, or HTMLAudioElement. |
streaming | boolean | true to use a media-element source node. |
Returns: FlxSoundHandle
destroy()
ts
destroy(): voidReturns: void
pauseAll()
ts
pauseAll(): voidReturns: void
resumeAll()
ts
resumeAll(): voidReturns: void
setGlobalMute()
ts
setGlobalMute(muted: boolean): voidParameters:
| Parameter | Type | Description |
|---|---|---|
muted | boolean | - |
Returns: void
setGlobalVolume()
ts
setGlobalVolume(volume: number): voidParameters:
| Parameter | Type | Description |
|---|---|---|
volume | number | - |
Returns: void
unlockAudio()
ts
unlockAudio(): voidWire gesture listeners (click/keydown/touchstart) to unlock audio.
Returns: void