Skip to content

Commit

Permalink
[#470] updated documentation and added instance_id parameter to stop/…
Browse files Browse the repository at this point in the history
…pause functions
  • Loading branch information
obiot committed Apr 1, 2014
1 parent 7b44472 commit 5719fe0
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/audio/audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
* @param {Boolean}
* [loop=false] loop audio
* @param {Function}
* [callback] callback function
* [callback] returns the unique playback id for this sound instance.
* @param {Number}
* [volume=default] Float specifying volume (0.0 - 1.0 values accepted).
* @example
Expand Down Expand Up @@ -206,32 +206,33 @@
* @public
* @function
* @param {String} sound_id audio clip id
* @param {String} [id] the play instance ID.
* @example
* me.audio.stop("cling");
*/
obj.stop = function (sound_id) {
obj.stop = function (sound_id, instance_id) {
var sound = audioTracks[sound_id.toLowerCase()];
if (sound && typeof sound !== "undefined") {
sound.stop();
sound.stop(instance_id);
}
};

/**
* pause the specified sound on all channels<br>
* this function does not reset the currentTime property
*
* @name pause
* @memberOf me.audio
* @public
* @function
* @param {String} sound_id audio clip id
* @param {String} [id] the play instance ID.
* @example
* me.audio.pause("cling");
*/
obj.pause = function (sound_id) {
obj.pause = function (sound_id, instance_id) {
var sound = audioTracks[sound_id.toLowerCase()];
if (sound && typeof sound !== "undefined") {
sound.pause();
sound.pause(instance_id);
}
};

Expand Down

0 comments on commit 5719fe0

Please sign in to comment.