You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/sound/BaseSoundManager.js
+5-6Lines changed: 5 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -14,12 +14,7 @@ var NOOP = require('../utils/NOOP');
14
14
15
15
/**
16
16
* @classdesc
17
-
* The sound manager is responsible for playing back audio via Web Audio API or HTML Audio tag as fallback.
18
-
* The audio file type and the encoding of those files are extremely important.
19
-
*
20
-
* Not all browsers can play all audio formats.
21
-
*
22
-
* There is a good guide to what's supported [here](https://developer.mozilla.org/en-US/Apps/Fundamentals/Audio_and_video_delivery/Cross-browser_audio_basics#Audio_Codec_Support).
17
+
* Base class for other Sound Manager classes.
23
18
*
24
19
* @class BaseSoundManager
25
20
* @extends Phaser.Events.EventEmitter
@@ -28,6 +23,10 @@ var NOOP = require('../utils/NOOP');
28
23
* @since 3.0.0
29
24
*
30
25
* @param {Phaser.Game} game - Reference to the current game instance.
Copy file name to clipboardExpand all lines: src/sound/html5/HTML5AudioSoundManager.js
+6-3Lines changed: 6 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -12,16 +12,19 @@ var HTML5AudioSound = require('./HTML5AudioSound');
12
12
13
13
/**
14
14
* HTML5 Audio implementation of the Sound Manager.
15
-
*
16
-
* Note: To play multiple instances of the same HTML5 Audio sound, you need to provide an `instances` value when
15
+
*
16
+
* To play multiple instances of the same HTML5 Audio sound, you need to provide an `instances` value when
17
17
* loading the sound with the Loader:
18
-
*
18
+
*
19
19
* ```javascript
20
20
* this.load.audio('explosion', 'explosion.mp3', {
21
21
* instances: 2
22
22
* });
23
23
* ```
24
24
*
25
+
* Not all browsers can play all audio formats.
26
+
* There is a good guide to what's supported: [Cross-browser audio basics: Audio codec support](https://developer.mozilla.org/en-US/Apps/Fundamentals/Audio_and_video_delivery/Cross-browser_audio_basics#Audio_Codec_Support).
Copy file name to clipboardExpand all lines: src/sound/webaudio/WebAudioSoundManager.js
+13-10Lines changed: 13 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,10 @@ var WebAudioSound = require('./WebAudioSound');
13
13
14
14
/**
15
15
* @classdesc
16
-
* Web Audio API implementation of the sound manager.
16
+
* Web Audio API implementation of the Sound Manager.
17
+
*
18
+
* Not all browsers can play all audio formats.
19
+
* There is a good guide to what's supported: [Cross-browser audio basics: Audio codec support](https://developer.mozilla.org/en-US/Apps/Fundamentals/Audio_and_video_delivery/Cross-browser_audio_basics#Audio_Codec_Support).
17
20
*
18
21
* @class WebAudioSoundManager
19
22
* @extends Phaser.Sound.BaseSoundManager
@@ -117,7 +120,7 @@ var WebAudioSoundManager = new Class({
117
120
/**
118
121
* This method takes a new AudioContext reference and then sets
119
122
* this Sound Manager to use that context for all playback.
120
-
*
123
+
*
121
124
* As part of this call it also disconnects the master mute and volume
122
125
* nodes and then re-creates them on the new given context.
123
126
*
@@ -180,16 +183,16 @@ var WebAudioSoundManager = new Class({
180
183
181
184
/**
182
185
* Decode audio data into a format ready for playback via Web Audio.
183
-
*
186
+
*
184
187
* The audio data can be a base64 encoded string, an audio media-type data uri, or an ArrayBuffer instance.
185
-
*
188
+
*
186
189
* The `audioKey` is the key that will be used to save the decoded audio to the audio cache.
187
-
*
190
+
*
188
191
* Instead of passing a single entry you can instead pass an array of `Phaser.Types.Sound.DecodeAudioConfig`
189
192
* objects as the first and only argument.
190
-
*
193
+
*
191
194
* Decoding is an async process, so be sure to listen for the events to know when decoding has completed.
192
-
*
195
+
*
193
196
* Once the audio has decoded it can be added to the Sound Manager or played via its key.
0 commit comments