Skip to content

Commit 1c1e75a

Browse files
Defining rate property in BaseSound class so it can be used in both Web Audio and HTML5 Audio implementations
1 parent 27ad50d commit 1c1e75a

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

v3/src/sound/BaseSoundManager.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,19 @@ var BaseSoundManager = new Class({
111111
},
112112
destroy: NOOP
113113
});
114+
/**
115+
* Global playback rate.
116+
* @property {number} rate
117+
*/
118+
Object.defineProperty(BaseSoundManager.prototype, 'rate', {
119+
get: function () {
120+
return this._rate;
121+
},
122+
set: function (value) {
123+
this._rate = value;
124+
this.sounds.forEach(function (sound) {
125+
sound.setRate();
126+
}, this);
127+
}
128+
});
114129
module.exports = BaseSoundManager;

0 commit comments

Comments
 (0)