|
@@ -95,7 +95,7 @@ Audio.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
var source = this.context.createBufferSource();
|
|
|
|
|
|
source.buffer = this.buffer;
|
|
|
- source.detune.value = this.detune;
|
|
|
+ this.setDetune( this.detune );
|
|
|
source.loop = this.loop;
|
|
|
source.onended = this.onEnded.bind( this );
|
|
|
source.playbackRate.setValueAtTime( this.playbackRate, this.startTime );
|
|
@@ -228,6 +228,13 @@ Audio.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
|
|
|
this.detune = value;
|
|
|
|
|
|
+ if ( this.source.detune === undefined ) {
|
|
|
+
|
|
|
+ console.warn( 'THREE.Audio: AudioBufferSourceNode.detune not supported by the browser.' );
|
|
|
+ return;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
if ( this.isPlaying === true ) {
|
|
|
|
|
|
this.source.detune.setTargetAtTime( this.detune, this.context.currentTime, 0.01 );
|