Skip to content

Commit

Permalink
Added rate parameter to game.Audio.playSound
Browse files Browse the repository at this point in the history
  • Loading branch information
ekelokorpi committed Jan 7, 2018
1 parent a92a453 commit ca98558
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/engine/audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,13 @@ game.createClass('Audio', {
@method playSound
@param {String} name
@param {Number} [volume]
@param {Number} [rate]
@return {Sound}
**/
playSound: function(name, volume) {
playSound: function(name, volume, rate) {
var sound = new game.Sound(name);
sound.volume = volume || sound.volume;
sound.rate = rate || sound._rate;
sound.play();
return sound;
},
Expand Down

0 comments on commit ca98558

Please sign in to comment.