Skip to content

Conversation

@ngokevin
Copy link
Contributor

@ngokevin ngokevin commented Jan 15, 2019

Fixes #15566

source.buffer = this.buffer;
source.detune.value = this.detune;

if ( source.detune ) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if it is zero? Test for undefined?


this.detune = value;

if ( !this.source.detune ) return;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if ( ! this.source.detune ) return;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add a warning here:

console.warn( 'THREE.Audio: AudioBufferSourceNode.detune not supported by the browser.' );

@Mugen87 Mugen87 mentioned this pull request Jan 15, 2019
@Mugen87 Mugen87 changed the title add checks for detune on audio buffer for safari (fixes #15566) Audio: Add checks for detune on audio buffer for Safari Jan 15, 2019
@ngokevin
Copy link
Contributor Author

Updated.


source.buffer = this.buffer;
source.detune.value = this.detune;
this.setDetune( this.detune );
Copy link
Collaborator

@Mugen87 Mugen87 Jan 21, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is a problem if you set detune like this. Since isPlaying is still false at this line, the value is actually not assigned to the AudioBufferSourceNode.

Copy link
Owner

@mrdoob mrdoob Jan 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely worth investigating, but I'll merge this for now so we no longer break in iOS 12.

@mrdoob mrdoob added this to the r101 milestone Jan 23, 2019
@mrdoob mrdoob merged commit 86c46eb into mrdoob:dev Jan 25, 2019
@mrdoob
Copy link
Owner

mrdoob commented Jan 25, 2019

Thanks!

joshmarinacci added a commit to MozillaReality/mred that referenced this pull request May 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants