|
@@ -95,10 +95,8 @@ Audio.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
var source = this.context.createBufferSource();
|
|
|
|
|
|
source.buffer = this.buffer;
|
|
|
- this.setDetune( this.detune );
|
|
|
source.loop = this.loop;
|
|
|
source.onended = this.onEnded.bind( this );
|
|
|
- source.playbackRate.setValueAtTime( this.playbackRate, this.startTime );
|
|
|
this.startTime = this.context.currentTime;
|
|
|
source.start( this.startTime, this.offset );
|
|
|
|
|
@@ -106,6 +104,9 @@ Audio.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
|
|
|
this.source = source;
|
|
|
|
|
|
+ this.setDetune( this.detune );
|
|
|
+ this.setPlaybackRate( this.playbackRate );
|
|
|
+
|
|
|
return this.connect();
|
|
|
|
|
|
},
|
|
@@ -228,12 +229,7 @@ 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.source.detune === undefined ) return; // only set detune when available
|
|
|
|
|
|
if ( this.isPlaying === true ) {
|
|
|
|