Skip to content

Commit

Permalink
Audio: Make setDetune() more robust. (mrdoob#27479)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mugen87 authored and AdaRoseCannon committed Jan 15, 2024
1 parent 28a9a86 commit b8448f7
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/audio/Audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down

0 comments on commit b8448f7

Please sign in to comment.