Mutes or unmutes the background music.
True to mute, false to unmute.
Resumes the background music playback if paused.
Plays or changes the background music. Disposes the previous background music if it exists.
The URL of the music file to play.
Optional
volume: numberSets the global audio engine volume.
The volume level (0.0 to 1.0).
Stops the background music playback.
Unlocks the audio engine (required by some browsers before playback).
Static
getReturns the singleton instance of NocturnaAudio, initializing it if necessary.
NocturnaAudio manages all audio playback in Nocturna using Babylon.js's audio engine.
Responsibilities:
Usage:
await NocturnaAudio.getInstance()
to get the singleton instance.setBackgroundMusic
to play or change background music.muteBackgroundMusic
,stopBackgroundMusic
,resumeBackgroundMusic
, andsetVolume
for playback control.