Skip to content

Commit d607022

Browse files
committed
add checks for detune on audio buffer for safari (fixes #15566)
1 parent 55a392b commit d607022

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/audio/Audio.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,13 @@ Audio.prototype = Object.assign( Object.create( Object3D.prototype ), {
9595
var source = this.context.createBufferSource();
9696

9797
source.buffer = this.buffer;
98-
source.detune.value = this.detune;
98+
99+
if ( source.detune ) {
100+
101+
source.detune.value = this.detune;
102+
103+
}
104+
99105
source.loop = this.loop;
100106
source.onended = this.onEnded.bind( this );
101107
source.playbackRate.setValueAtTime( this.playbackRate, this.startTime );
@@ -228,6 +234,8 @@ Audio.prototype = Object.assign( Object.create( Object3D.prototype ), {
228234

229235
this.detune = value;
230236

237+
if ( !this.source.detune ) return;
238+
231239
if ( this.isPlaying === true ) {
232240

233241
this.source.detune.setTargetAtTime( this.detune, this.context.currentTime, 0.01 );

0 commit comments

Comments
 (0)