mirror of
https://github.com/photonstorm/phaser
synced 2024-12-21 02:23:29 +00:00
1 line
No EOL
9.2 KiB
JSON
1 line
No EOL
9.2 KiB
JSON
{"class":{"name":"Phaser.SoundManager","extends":"","static":false,"constructor":true,"parameters":[{"name":"game","type":["Phaser.Game"],"help":" reference to the current game instance.","optional":false,"default":null}],"help":"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.\\nNote: On Firefox 25+ on Linux if you have media.gstreamer disabled in about:config then it cannot play back mp3 or m4a files.\\nThe audio file type and the encoding of those files are extremely important. Not all browsers can play all audio formats.\\nThere is a good guide to what's supported here: http:\/\/hpr.dogphilosophy.net\/test\/"},"consts":[],"methods":{"public":[{"name":"add","static":false,"returns":{"types":["Phaser.Sound"],"help":"The new sound instance."},"help":"Adds a new Sound into the SoundManager.","line":355,"public":true,"protected":false,"private":false,"parameters":[{"name":"key","type":["string"],"help":"Asset key for the sound.","optional":false,"default":null},{"name":"volume","type":["number"],"help":"Default value for the volume.","optional":true,"default":"1"},{"name":"loop","type":["boolean"],"help":"Whether or not the sound will loop.","optional":true,"default":"false"},{"name":"connect","type":["boolean"],"help":"Controls if the created Sound object will connect to the master gainNode of the SoundManager when running under WebAudio.","optional":true,"default":"true"}],"inherited":false,"inheritedFrom":""},{"name":"addSprite","static":false,"returns":{"types":["Phaser.AudioSprite"],"help":"The new AudioSprite instance."},"help":"Adds a new AudioSprite into the SoundManager.","line":376,"public":true,"protected":false,"private":false,"parameters":[{"name":"key","type":["string"],"help":"Asset key for the sound.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"decode","static":false,"returns":null,"help":"Decode a sound by its assets key.","line":291,"public":true,"protected":false,"private":false,"parameters":[{"name":"key","type":["string"],"help":"Assets key of the sound to be decoded.","optional":false,"default":null},{"name":"sound","type":["Phaser.Sound"],"help":"Its buffer will be set to decoded data.","optional":true,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"destroy","static":false,"returns":null,"help":"Stops all the sounds in the game, then destroys them and finally clears up any callbacks.","line":523,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"pauseAll","static":false,"returns":null,"help":"Pauses all the sounds in the game.","line":255,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"play","static":false,"returns":{"types":["Phaser.Sound"],"help":"The new sound instance."},"help":"Adds a new Sound into the SoundManager and starts it playing.","line":445,"public":true,"protected":false,"private":false,"parameters":[{"name":"key","type":["string"],"help":"Asset key for the sound.","optional":false,"default":null},{"name":"volume","type":["number"],"help":"Default value for the volume.","optional":true,"default":"1"},{"name":"loop","type":["boolean"],"help":"Whether or not the sound will loop.","optional":true,"default":"false"}],"inherited":false,"inheritedFrom":""},{"name":"remove","static":false,"returns":{"types":["boolean"],"help":"True if the sound was removed successfully, otherwise false."},"help":"Removes a Sound from the SoundManager. The removed Sound is destroyed before removal.","line":391,"public":true,"protected":false,"private":false,"parameters":[{"name":"sound","type":["Phaser.Sound"],"help":"The sound object to remove.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"removeByKey","static":false,"returns":{"types":["number"],"help":"The number of matching sound objects that were removed."},"help":"Removes all Sounds from the SoundManager that have an asset key matching the given value.\\nThe removed Sounds are destroyed before removal.","line":417,"public":true,"protected":false,"private":false,"parameters":[{"name":"key","type":["string"],"help":"The key to match when removing sound objects.","optional":false,"default":null}],"inherited":false,"inheritedFrom":""},{"name":"resumeAll","static":false,"returns":null,"help":"Resumes every sound in the game.","line":272,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"stopAll","static":false,"returns":null,"help":"Stops all the sounds in the game.","line":238,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"unlock","static":false,"returns":null,"help":"Enables the audio, usually after the first touch.","line":203,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"update","static":false,"returns":null,"help":"Updates every sound in the game.","line":322,"public":true,"protected":false,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""}],"protected":[{"name":"boot","static":false,"returns":null,"help":"Initialises the sound manager.","line":114,"public":false,"protected":true,"private":false,"parameters":[],"inherited":false,"inheritedFrom":""}],"private":[{"name":"setMute","static":false,"returns":null,"help":"Internal mute handler called automatically by the Sound.mute setter.","line":461,"public":false,"protected":false,"private":true,"parameters":[],"inherited":false,"inheritedFrom":""},{"name":"unsetMute","static":false,"returns":null,"help":"Internal mute handler called automatically by the Sound.mute setter.","line":493,"public":false,"protected":false,"private":true,"parameters":[],"inherited":false,"inheritedFrom":""}],"static":[]},"properties":{"public":[{"name":"channels","type":["number"],"help":"","inlineHelp":"The number of audio channels to use in playback.","line":103,"default":"32","public":true,"protected":false,"private":false,"readOnly":false},{"name":"connectToMaster","type":["boolean"],"help":"","inlineHelp":"Used in conjunction with Sound.externalNode this allows you to stop a Sound node being connected to the SoundManager master gain node.","line":91,"default":"true","public":true,"protected":false,"private":false,"readOnly":false},{"name":"context","type":["AudioContext"],"help":"","inlineHelp":"The AudioContext being used for playback.","line":67,"default":"null","public":true,"protected":false,"private":false,"readOnly":false},{"name":"game","type":["Phaser.Game"],"help":"","inlineHelp":"Local reference to game.","line":22,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"mute","type":["boolean"],"help":"","inlineHelp":"Gets or sets the muted state of the SoundManager. This effects all sounds in the game.","line":548,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"noAudio","type":["boolean"],"help":"","inlineHelp":"Has audio been disabled via the PhaserGlobal object? Useful if you need to use a 3rd party audio library instead.","line":85,"default":"false","public":true,"protected":false,"private":false,"readOnly":false},{"name":"onSoundDecode","type":["Phaser.Signal"],"help":"","inlineHelp":"The event dispatched when a sound decodes (typically only for mp3 files)","line":27,"default":null,"public":true,"protected":false,"private":false,"readOnly":false},{"name":"touchLocked","type":["boolean"],"help":"","inlineHelp":"true if the audio system is currently locked awaiting a touch event.","line":97,"default":"false","public":true,"protected":false,"private":false,"readOnly":false},{"name":"usingAudioTag","type":["boolean"],"help":"","inlineHelp":"true if the sound is being played via the Audio tag.","line":79,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"usingWebAudio","type":["boolean"],"help":"","inlineHelp":"true if this sound is being played with Web Audio.","line":73,"default":null,"public":true,"protected":false,"private":false,"readOnly":true},{"name":"volume","type":["number"],"help":"","inlineHelp":"Gets or sets the global volume of the SoundManager, a value between 0 and 1.","line":588,"default":null,"public":true,"protected":false,"private":false,"readOnly":false}],"protected":[],"private":[{"name":"_codeMuted","type":["boolean"],"help":"","inlineHelp":"Internal mute tracking var.","line":34,"default":"false","public":false,"protected":false,"private":true,"readOnly":false},{"name":"_muted","type":["boolean"],"help":"","inlineHelp":"Internal mute tracking var.","line":41,"default":"false","public":false,"protected":false,"private":true,"readOnly":false},{"name":"_sounds","type":["array"],"help":"","inlineHelp":"An array containing all the sounds","line":61,"default":null,"public":false,"protected":false,"private":true,"readOnly":false},{"name":"_unlockSource","type":["AudioContext"],"help":"","inlineHelp":"Internal unlock tracking var.","line":48,"default":"null","public":false,"protected":false,"private":true,"readOnly":false},{"name":"_volume","type":["number"],"help":"","inlineHelp":"The global audio volume. A value between 0 (silence) and 1 (full volume).","line":55,"default":"1","public":false,"protected":false,"private":true,"readOnly":false}]}} |