the reference to the current game instance.
Adds a new Sound into the SoundManager.
Adds a new Sound into the SoundManager.
Asset key for the sound.
Default value for the volume.
Whether or not the sound will loop.
Controls if the created Sound object will connect to the master gainNode of the SoundManager when running under WebAudio.
The new sound instance.
Adds a new AudioSprite into the SoundManager.
Adds a new AudioSprite into the SoundManager.
Asset key for the sound.
The new AudioSprite instance.
This member is internal (protected) and may be modified or removed in the future.
This member is internal (protected) and may be modified or removed in the future. Internal: This member is internal (protected) and may be modified or removed in the future.
The number of audio channels to use in playback (default: 32).
Used in conjunction with Sound.externalNode this allows you to stop a Sound node being connected to the SoundManager master gain node (default: true).
The AudioContext being used for playback.
Decode a sound by its asset key.
Decode a sound by its asset key.
Assets key of the sound to be decoded.
Optional: Its buffer will be set to decoded data.
Stops all the sounds in the game, then destroys them and finally clears up any callbacks.
the reference to the current game instance.
Gets or sets the muted state of the SoundManager.
Gets or sets the muted state of the SoundManager. This effects all sounds in the game.
True if audio been disabled via the PhaserGlobal (useful if you need to use a 3rd party audio library) or the device doesn't support any audio.
True if audio been disabled via the PhaserGlobal (useful if you need to use a 3rd party audio library) or the device doesn't support any audio.
This signal is dispatched when the SoundManager is globally un-muted, either directly via game code or as a result of the game resuming from a pause.
The event dispatched when a sound decodes (typically only for mp3 files)
This signal is dispatched when the SoundManager is globally un-muted, either directly via game code or as a result of the game resuming from a pause.
This signal is dispatched whenever the global volume changes.
This signal is dispatched whenever the global volume changes. The new volume is passed as the only parameter to your callback.
Pauses all the sounds in the game.
Adds a new Sound into the SoundManager and starts it playing.
Adds a new Sound into the SoundManager and starts it playing.
Asset key for the sound.
Optional: Default value for the volume (default: 1).
Optional: Whether or not the sound will loop (default: false).
The new sound instance.
Removes a Sound from the SoundManager.
Removes a Sound from the SoundManager. The removed Sound is destroyed before removal.
The sound object to remove.
True if the sound was removed successfully, otherwise false.
Removes all Sounds from the SoundManager that have an asset key matching the given value.
Removes all Sounds from the SoundManager that have an asset key matching the given value. The removed Sounds are destroyed before removal.
The key to match when removing sound objects.
The number of matching sound objects that were removed.
Resumes every sound in the game.
This method allows you to give the SoundManager a list of Sound files, or keys, and a callback.
This method allows you to give the SoundManager a list of Sound files, or keys, and a callback. Once all of the Sound files have finished decoding the callback will be invoked. The amount of time spent decoding depends on the codec used and file size. If all of the files given have already decoded the callback is triggered immediately.
An array containing either Phaser.Sound objects or their key strings as found in the Phaser.Cache.
The callback which will be invoked once all files have finished decoding.
The context in which the callback will run.
Sets the Input Manager touch callback to be SoundManager.unlock.
Sets the Input Manager touch callback to be SoundManager.unlock. Required for iOS audio device unlocking. Mostly just used internally.
Stops all the sounds in the game.
true if the audio system is currently locked awaiting a touch event.
Enables the audio, usually after the first touch.
Updates every sound in the game, checks for audio unlock on mobile and monitors the decoding watch list.
Updates every sound in the game, checks for audio unlock on mobile and monitors the decoding watch list. Internal: This member is internal (protected) and may be modified or removed in the future.
True the SoundManager and device are both using the Audio tag instead of Web Audio.
True the SoundManager and device are both using Web Audio.
Gets or sets the global volume of the SoundManager, a value between 0 and 1.
Gets or sets the global volume of the SoundManager, a value between 0 and 1. The value given is clamped to the range 0 to 1.
The Sound Manager is responsible for playing back audio via either the Legacy HTML Audio tag or via Web Audio if the browser supports it. Note: On Firefox 25+ on Linux if you have media.gstreamer disabled in about:config then it cannot play back mp3 or m4a files. The audio file type and the encoding of those files are extremely important. Not all browsers can play all audio formats. There is a good guide to what's supported here: http://hpr.dogphilosophy.net/test/
If you are reloading a Phaser Game on a page that never properly refreshes (such as in an AngularJS project) then you will quickly run out of AudioContext nodes. If this is the case create a global var called PhaserGlobal on the window object before creating the game. The active AudioContext will then be saved to window.PhaserGlobal.audioContext when the Phaser game is destroyed, and re-used when it starts again.
Mobile warning: There are some mobile devices (certain iPad 2 and iPad Mini revisions) that cannot play 48000 Hz audio. When they try to play the audio becomes extremely distorted and buzzes, eventually crashing the sound system. The solution is to use a lower encoding rate such as 44100 Hz. Sometimes the audio context will be created with a sampleRate of 48000. If this happens and audio distorts you should re-create the context.