Gets the current amount of free players in the audio manager.
Same as play()
but waits until the user has interacted with the website.
ID of the file that should be played.
Optional
config: PlayConfigOptional parameter that will configure how the audio is played. Is no configuration provided, the audio will play at volume 1.0, without panning and on the SFX channel, priority set to false.
The playId that identifies this specific playback, so it can be stopped or identified in the emitter.
Decodes and stores the given audio files and associates them with the given ID.
Path to the audio files. Can either be a single string or a list of strings.
Identifier for the given audio files.
A Promise that resolves when all files are successfully loaded.
Same as load(), but lets you easily load a bunch of files without needing to call the manager everytime.
Rest
...pair: [string | string[], number][]Pair of source files and associating identifier. Multiple pairs can be provided as separate arguments.
A Promise that resolves when all files are successfully loaded.
Plays the audio file associated with the given ID.
ID of the file that should be played.
Optional
config: PlayConfigOptional parameter that will configure how the audio is played. Is no configuration provided, the audio will play at volume 1.0, without panning and on the SFX channel, priority set to false.
The playId that identifies this specific playback, so it can be stopped or identified in the emitter. If playback could not be started, an invalid playId is returned.
Plays the audio file associated with the given ID until it naturally ends.
ID of the file that should be played.
Optional
config: PlayConfigOptional parameter that will configure how the audio is played. Note that only the position and volume settings will affect the playback.
Sets the volume of the given audio channel.
Specifies the audio channel that should be modified.
Volume that the channel should be set to.
Optional time parameter that specifies the time it takes for the channel to reach the specified volume in seconds (Default is 0).
Manages audio files and players, providing control over playback on three audio channels.
Classdesc
The AudioManager handles audio files and players, offering control over playback on three distinct channels.
See
AudioChannel
Remarks
The AudioManager is able to play audio with spatial positioning. Keep in mind that for this to work correctly, you will need to set up the
audio-listener
component!Example