Browse Source

Audio: Make `setDetune()` more robust. (#27479)

Michael Herzog 1 year ago
parent
commit
1d57f1c070
1 changed files with 1 additions and 3 deletions
  1. 1 3
      src/audio/Audio.js

+ 1 - 3
src/audio/Audio.js

@@ -270,9 +270,7 @@ class Audio extends Object3D {
 
 
 		this.detune = value;
 		this.detune = value;
 
 
-		if ( this.source.detune === undefined ) return; // only set detune when available
-
-		if ( this.isPlaying === true ) {
+		if ( this.isPlaying === true && this.source.detune !== undefined ) {
 
 
 			this.source.detune.setTargetAtTime( this.detune, this.context.currentTime, 0.01 );
 			this.source.detune.setTargetAtTime( this.detune, this.context.currentTime, 0.01 );