소스 검색

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 );