ClassAudio System@public
WebAudioBackend
Browser AudioContext implementation of FlxAudioBackend.
Creates the AudioContext lazily on first play or unlockAudio(). Handles autoplay policy via a queue: sounds played before unlock are recorded and replayed on the first user gesture. By default, hiding the document suspends the context and returning resumes it.
ts
export declare class WebAudioBackend implements FlxAudioBackendConstructors
ts
constructor(options?: WebAudioBackendOptions)Constructs a new instance of the WebAudioBackend class
| Parameter | Type | Description |
|---|---|---|
options | WebAudioBackendOptions | - |
Properties
| Property | Modifiers | Type | Description |
|---|---|---|---|
suspended | readonly | boolean | - |
unlocked | readonly | boolean | - |
Methods
createSound()
ts
createSound(source: unknown, streaming: boolean): FlxSoundHandleParameters:
| Parameter | Type | Description |
|---|---|---|
source | unknown | - |
streaming | boolean | - |
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(): voidReturns: void