Skip to content

Commit dd56f4f

Browse files
Updated createAudioContext method docs
1 parent 8ae7ac4 commit dd56f4f

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

v3/src/sound/webaudio/WebAudioSoundManager.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,16 @@ var WebAudioSoundManager = new Class({
4949
BaseSoundManager.call(this, game);
5050
},
5151
/**
52+
* Method responsible for instantiating and returning AudioContext instance.
53+
* If an instance of an AudioContext class was provided trough the game config,
54+
* that instance will be returned instead. This can come in handy if you are reloading
55+
* a Phaser game on a page that never properly refreshes (such as in an SPA project)
56+
* and you want to reuse already instantiated AudioContext.
57+
*
5258
* @private
53-
* @param game
54-
* @returns {AudioContext}
59+
* @method Phaser.Sound.WebAudioSoundManager#createAudioContext
60+
* @param {Phaser.Game} game - Reference to the current game instance.
61+
* @returns {AudioContext} The AudioContext instance to be used for playback.
5562
*/
5663
createAudioContext: function (game) {
5764
var audioConfig = game.config.audio;

0 commit comments

Comments
 (0)