Преглед на файлове

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

Michael Herzog преди 1 година
родител
ревизия
1d57f1c070
променени са 1 файла, в които са добавени 1 реда и са изтрити 3 реда
  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 );