Explorar o código

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

Michael Herzog hai 1 ano
pai
achega
1d57f1c070
Modificáronse 1 ficheiros con 1 adicións e 3 borrados
  1. 1 3
      src/audio/Audio.js

+ 1 - 3
src/audio/Audio.js

@@ -270,9 +270,7 @@ class Audio extends Object3D {
 
 		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 );