diff --git a/v3/src/sound/BaseSound.js b/v3/src/sound/BaseSound.js index e206a7e51..dfd2c754d 100644 --- a/v3/src/sound/BaseSound.js +++ b/v3/src/sound/BaseSound.js @@ -65,6 +65,9 @@ var BaseSound = new Class({ * Represents detuning of sound in [cents](https://en.wikipedia.org/wiki/Cent_%28music%29). * The range of the value is -1200 to 1200, but we recommend setting it to [50](https://en.wikipedia.org/wiki/50_Cent). * + * Standards based Web Audio implementation only. + * Webkit Web Audio implementation and HTML5 Audio don't support this. + * * @property {number} detune */ this.detune = 0; diff --git a/v3/src/sound/webaudio/WebAudioSound.js b/v3/src/sound/webaudio/WebAudioSound.js index a03d47e8f..1cddcd145 100644 --- a/v3/src/sound/webaudio/WebAudioSound.js +++ b/v3/src/sound/webaudio/WebAudioSound.js @@ -108,6 +108,7 @@ var WebAudioSound = new Class({ this.source.buffer = this.audioBuffer; this.source.connect(this.muteNode); this.applyConfig(); + // TODO add onended event handler to reset sound state this.source.start(0, offset, duration); }, /** @@ -177,7 +178,7 @@ Object.defineProperty(WebAudioSound.prototype, 'detune', { }, set: function (value) { this.currentConfig.detune = value; - if (this.source) { + if (this.source && this.source.detune) { this.source.detune.value = Math.max(-1200, Math.min(value + this.manager.detune, 1200)); }