File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ 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+ this . setDetune ( this . detune ) ;
9999 source . loop = this . loop ;
100100 source . onended = this . onEnded . bind ( this ) ;
101101 source . playbackRate . setValueAtTime ( this . playbackRate , this . startTime ) ;
@@ -228,6 +228,13 @@ Audio.prototype = Object.assign( Object.create( Object3D.prototype ), {
228228
229229 this . detune = value ;
230230
231+ if ( this . source . detune === undefined ) {
232+
233+ console . warn ( 'THREE.Audio: AudioBufferSourceNode.detune not supported by the browser.' ) ;
234+ return ;
235+
236+ }
237+
231238 if ( this . isPlaying === true ) {
232239
233240 this . source . detune . setTargetAtTime ( this . detune , this . context . currentTime , 0.01 ) ;
You can’t perform that action at this time.
0 commit comments