@@ -95,16 +95,6 @@ AudioFile.create = function (loader, key, urls, config, xhrSettings)
9595 var audioConfig = game . config . audio ;
9696 var deviceAudio = game . device . audio ;
9797
98- /**
99- * [description]
100- *
101- * @method Phaser.Loader.FileTypes.AudioFile#
102- * @since 3.0.0
103- *
104- * @param {[type] } (audioConfig && audioConfig.noAudio) || (!deviceAudio.webAudio && !deviceAudio.audioData) - [description]
105- *
106- * @return {[type] } [description]
107- */
10898 if ( ( audioConfig && audioConfig . noAudio ) || ( ! deviceAudio . webAudio && ! deviceAudio . audioData ) )
10999 {
110100 console . info ( 'Skipping loading audio \'' + key + '\' since sounds are disabled.' ) ;
@@ -113,68 +103,44 @@ AudioFile.create = function (loader, key, urls, config, xhrSettings)
113103
114104 var url = AudioFile . findAudioURL ( game , urls ) ;
115105
116- /**
117- * [description]
118- *
119- * @method Phaser.Loader.FileTypes.AudioFile#
120- * @since 3.0.0
121- *
122- * @param {[type] } !url - [description]
123- *
124- * @return {[type] } [description]
125- */
126106 if ( ! url )
127107 {
128108 console . warn ( 'No supported url provided for audio \'' + key + '\'!' ) ;
129109 return null ;
130110 }
131111
132- /**
133- * [description]
134- *
135- * @method Phaser.Loader.FileTypes.AudioFile#
136- * @since 3.0.0
137- *
138- * @param {[type] } deviceAudio.webAudio && !(audioConfig && audioConfig.disableWebAudio) - [description]
139- *
140- * @return {[type] } [description]
141- */
142112 if ( deviceAudio . webAudio && ! ( audioConfig && audioConfig . disableWebAudio ) )
143113 {
144114 return new AudioFile ( key , url , loader . path , xhrSettings , game . sound . context ) ;
145115 }
146- /**
147- * [description]
148- *
149- * @method Phaser.Loader.FileTypes.AudioFile#
150- * @since 3.0.0
151- *
152- * @return {[type] } [description]
153- */
154116 else
155117 {
156118 return new HTML5AudioFile ( key , url , loader . path , config , game . sound . locked ) ;
157119 }
158120} ;
159121
160- // When registering a factory function 'this' refers to the Loader context.
161- //
162- // There are several properties available to use:
163- //
164- // this.scene - a reference to the Scene that owns the GameObjectFactory
165-
122+ /**
123+ * Adds an Audio file to the current load queue.
124+ *
125+ * Note: This method will only be available if the Audio File type has been built into Phaser.
126+ *
127+ * The file is **not** loaded immediately after calling this method.
128+ * Instead, the file is added to a queue within the Loader, which is processed automatically when the Loader starts.
129+ *
130+ * @method Phaser.Loader.LoaderPlugin#audio
131+ * @since 3.0.0
132+ *
133+ * @param {string } key - [description]
134+ * @param {string|string[] } urls - [description]
135+ * @param {object } config - [description]
136+ * @param {object } xhrSettings - [description]
137+ *
138+ * @return {Phaser.Loader.LoaderPlugin } The Loader.
139+ */
166140FileTypesManager . register ( 'audio' , function ( key , urls , config , xhrSettings )
167141{
168142 var audioFile = AudioFile . create ( this , key , urls , config , xhrSettings ) ;
169143
170- /**
171- * [description]
172- *
173- * @method Phaser.Loader.FileTypes.AudioFile#
174- * @since 3.0.0
175- *
176- * @param {[type] } audioFile - [description]
177- */
178144 if ( audioFile )
179145 {
180146 this . addFile ( audioFile ) ;
@@ -229,29 +195,11 @@ FileTypesManager.register('audio', function (key, urls, config, xhrSettings)
229195
230196AudioFile . findAudioURL = function ( game , urls )
231197{
232- /**
233- * [description]
234- *
235- * @method Phaser.Loader.FileTypes.AudioFile#
236- * @since 3.0.0
237- *
238- * @param {[type] } urls.constructor !== Array - [description]
239- */
240198 if ( urls . constructor !== Array )
241199 {
242200 urls = [ urls ] ;
243201 }
244202
245- /**
246- * [description]
247- *
248- * @method Phaser.Loader.FileTypes.AudioFile#
249- * @since 3.0.0
250- *
251- * @param {[type] } var i = 0; i < urls.length; i++ - [description]
252- *
253- * @return {[type] } [description]
254- */
255203 for ( var i = 0 ; i < urls . length ; i ++ )
256204 {
257205 var url = GetFastValue ( urls [ i ] , 'uri' , urls [ i ] ) ;
0 commit comments