Interface IWebAudioEngineOptions
audioContext: AudioContext;
defaultUIParentElement?: HTMLElement;
disableDefaultUI?: boolean;
disableIOSRingerSwitchWorkaround?: boolean;
listenerAutoUpdate: boolean;
listenerEnabled: boolean;
listenerMinUpdateTime: number;
listenerPosition: Vector3;
listenerRotation: Vector3;
listenerRotationQuaternion: Quaternion;
parameterRampDuration: number;
resumeOnInteraction: boolean;
resumeOnPause: boolean;
resumeOnPauseRetryInterval: number;
volume: number;
}
Hierarchy (View Summary)
- IAudioEngineV2Options
- IWebAudioEngineOptions
Properties
audio Context
The audio context to be used by the engine.
Optionaldefault UI Parent Element
The default UI's parent element. Defaults to the last created graphics engine's canvas if it exists; otherwise the HTML document's body.
Optionaldisable Default UI
Set to true to disable the default UI. Defaults to false.
Optionaldisable IOS Ringer Switch Workaround
Set to true to disable the silent HTML audio element used to allow WebAudio playback when the iOS ringer switch is off.
This can avoid rendering performance degradation on affected iOS and iPadOS devices, but WebAudio may be muted when the ringer switch is off.
Defaults to false.
listener Auto Update
Whether to automatically update the position and rotation of the listener. Defaults to true.
listener Enabled
Set to true to enable the listener. Defaults to false.
listener Min Update Time
The minimum update time in seconds of the listener if it is attached to a mesh, scene or transform node. Defaults to 0.
- The listener's position and rotation will not update faster than this time, but they may update slower depending on the frame rate.
listener Position
The listener position. Defaults to (0, 0, 0).
listener Rotation
The listener rotation, as Euler angles. Defaults to (0, 0, 0).
listener Rotation Quaternion
The listener rotation, as a quaternion. Defaults to (0, 0, 0, 1).
parameter Ramp Duration
The smoothing duration to use when changing audio parameters, in seconds. Defaults to 0.01 (10 milliseconds).
resume On Interaction
Set to true to automatically resume the audio context when the user interacts with the page. Defaults to true.
resume On Pause
Set to true to automatically resume the audio context when the browser pauses audio playback. Defaults to true.
resume On Pause Retry Interval
The interval in milliseconds to try resuming audio playback when resumeOnPause is true. Defaults to 1000.
volume
The initial output volume of the audio engine. Defaults to 1.
Options for creating a v2 audio engine that uses the WebAudio API.