Skip to content

Commit 28ae081

Browse files
Defining detune property in BaseSound class so it can be used in both Web Audio and HTML5 Audio implementations
1 parent 1c1e75a commit 28ae081

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
@@ -126,4 +126,19 @@ Object.defineProperty(BaseSoundManager.prototype, 'rate', {
126126
}, this);
127127
}
128128
});
129+
/**
130+
* Global detune.
131+
* @property {number} detune
132+
*/
133+
Object.defineProperty(BaseSoundManager.prototype, 'detune', {
134+
get: function () {
135+
return this._detune;
136+
},
137+
set: function (value) {
138+
this._detune = value;
139+
this.sounds.forEach(function (sound) {
140+
sound.setRate();
141+
}, this);
142+
}
143+
});
129144
module.exports = BaseSoundManager;

0 commit comments

Comments
 (0)