Interface AudioPlayerOptions

AudioPlayer component configuration

const audioPlayer = new AudioPlayer({
audioSource: "sound.mp3",
volume: 0.5,
loop: true,
fixedToTimeScale: false
});
interface AudioPlayerOptions {
    action: AudioPlayerAction;
    audioSource: string | HTMLAudioElement;
    fixedToTimeScale: boolean;
    loop: boolean;
    stopOnSceneTransition: boolean;
    volume: number;
}

Properties

The action to perform with the audio source.

audioSource: string | HTMLAudioElement

The audio source to play.

fixedToTimeScale: boolean

TRUE If the playback rate is fixed to the TimeManager time scale, default FALSE

loop: boolean

TRUE If the audio source should loop.

stopOnSceneTransition: boolean

TRUE If the audio source should stop on scene transition, FALSE otherwise. Default is TRUE.

volume: number

The volume of the audio source.