Skip to content

Commit 5719fe0

Browse files
committed
[#470] updated documentation and added instance_id parameter to stop/pause functions
1 parent 7b44472 commit 5719fe0

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/audio/audio.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@
176176
* @param {Boolean}
177177
* [loop=false] loop audio
178178
* @param {Function}
179-
* [callback] callback function
179+
* [callback] returns the unique playback id for this sound instance.
180180
* @param {Number}
181181
* [volume=default] Float specifying volume (0.0 - 1.0 values accepted).
182182
* @example
@@ -206,32 +206,33 @@
206206
* @public
207207
* @function
208208
* @param {String} sound_id audio clip id
209+
* @param {String} [id] the play instance ID.
209210
* @example
210211
* me.audio.stop("cling");
211212
*/
212-
obj.stop = function (sound_id) {
213+
obj.stop = function (sound_id, instance_id) {
213214
var sound = audioTracks[sound_id.toLowerCase()];
214215
if (sound && typeof sound !== "undefined") {
215-
sound.stop();
216+
sound.stop(instance_id);
216217
}
217218
};
218219

219220
/**
220221
* pause the specified sound on all channels<br>
221222
* this function does not reset the currentTime property
222-
*
223223
* @name pause
224224
* @memberOf me.audio
225225
* @public
226226
* @function
227227
* @param {String} sound_id audio clip id
228+
* @param {String} [id] the play instance ID.
228229
* @example
229230
* me.audio.pause("cling");
230231
*/
231-
obj.pause = function (sound_id) {
232+
obj.pause = function (sound_id, instance_id) {
232233
var sound = audioTracks[sound_id.toLowerCase()];
233234
if (sound && typeof sound !== "undefined") {
234-
sound.pause();
235+
sound.pause(instance_id);
235236
}
236237
};
237238

0 commit comments

Comments
 (0)