Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes safari browser missing buffer when using webaudio #1096

Merged
merged 9 commits into from
Jul 2, 2017

Conversation

entonbiba
Copy link
Contributor

@entonbiba entonbiba commented May 16, 2017

fixes #952 safari buffer undefined

var newBuffer = this.createBuffer(1, 4096, this.sampleRate);
  • it creates the missing buffer based on 1 channel, 4096 samples and the sampleRate from the current webaudio context.

@entonbiba entonbiba added the bug label May 16, 2017
@thijstriemstra
Copy link
Contributor

why are these values (1 channel, 4095 samples) hard coded? I guess Safari doesn't supply these values somewhere?

@entonbiba
Copy link
Contributor Author

@thijstriemstra yea that's the problem it doesn't. Safari TP should return the correct buffer, but it's a long way until that will be available. For now that's the best we can do to fix it in safari.

src/webaudio.js Outdated
@@ -223,6 +223,11 @@ WaveSurfer.WebAudio = {

this.setLength(length);

if (!this.buffer.length) {
Copy link
Owner

Choose a reason for hiding this comment

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

Could you add a short comment regarding the Safari quirk?

Copy link
Contributor

Choose a reason for hiding this comment

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

ping @entonbiba

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@katspaugh sure

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@katspaugh katspaugh merged commit 64bd48b into master Jul 2, 2017
@katspaugh
Copy link
Owner

Thank you @entonbiba!

@katspaugh katspaugh deleted the entonbiba-patch-safaribufferfix branch July 2, 2017 18:49
mspae pushed a commit to mspae/wavesurfer.js that referenced this pull request Aug 18, 2017
* fixes safari browser missing buffer when using webaudio

* return correct buffer

* set samples to 4096

* add safari comment
mspae pushed a commit that referenced this pull request Aug 19, 2017
* fixes safari browser missing buffer when using webaudio

* return correct buffer

* set samples to 4096

* add safari comment
@thijstriemstra
Copy link
Contributor

yea that's the problem it doesn't. Safari TP should return the correct buffer, but it's a long way until that will be available.

@entonbiba can this workaround be removed yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How can I play one song and have 2 waveforms in sync? & safari render issue
3 participants