Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Comments

Possible IOS 9 audio fix for slow audio#8

Open
chrisschaub wants to merge 1 commit intonehz:masterfrom
chrisschaub:master
Open

Possible IOS 9 audio fix for slow audio#8
chrisschaub wants to merge 1 commit intonehz:masterfrom
chrisschaub:master

Conversation

@chrisschaub
Copy link

Possible fix for ios 9 slow / distorted audio.

@nehz
Copy link
Owner

nehz commented Feb 10, 2016

Curious, why offlineAudioContext ?

@chrisschaub
Copy link
Author

Well, it was the only way I could set the rate to 44100, other attempts
didn't set the buffer correctly.

On Tue, Feb 9, 2016 at 8:35 PM, Zhen Wang notifications@github.com wrote:

Curious, why offlineAudioContext ?


Reply to this email directly or view it on GitHub
#8 (comment).

Christopher Schaub
http://chris.schaub.com

@chrisschaub
Copy link
Author

The number was set, but you have to set it "before" decodeAudioData is run,
it seems to prime the pump.

On Tue, Feb 9, 2016 at 8:50 PM, Christopher Schaub chris@schaub.com wrote:

Well, it was the only way I could set the rate to 44100, other attempts
didn't set the buffer correctly.

On Tue, Feb 9, 2016 at 8:35 PM, Zhen Wang notifications@github.com
wrote:

Curious, why offlineAudioContext ?


Reply to this email directly or view it on GitHub
#8 (comment).

Christopher Schaub
http://chris.schaub.com

Christopher Schaub
http://chris.schaub.com

@nehz
Copy link
Owner

nehz commented Feb 10, 2016

Right. That's weird ... not sure how Apple is messing it up as the offline buffer isn't even rendered yet (https://developer.mozilla.org/en-US/docs/Web/API/OfflineAudioContext), but somehow just initializing an offline buffer fixes the audio context?

@nehz
Copy link
Owner

nehz commented Feb 10, 2016

Also was there a reason for choosing 2 audio channels for the offline buffer? (Trying to reverse engineer why it works)

@chrisschaub
Copy link
Author

I'm actually testing touchend with this

https://github.com/Jam3/ios-safe-audio-context/blob/master/index.js

instead. More soon.

On Tue, Feb 9, 2016 at 9:42 PM, Zhen Wang notifications@github.com wrote:

Also was there a reason for choosing 2 audio channels for the offline
buffer? (Trying to reverse engineer why it works)


Reply to this email directly or view it on GitHub
#8 (comment).

Christopher Schaub
http://chris.schaub.com

@chrisschaub
Copy link
Author

What's the easiest way to disable webaudio and just fall back to html5
audio? I can't duplicate the issue on iphone 6s, just iphone 6. Apple needs
to fix this.

On Tue, Feb 9, 2016 at 9:43 PM, Christopher Schaub chris@schaub.com wrote:

I'm actually testing touchend with this

https://github.com/Jam3/ios-safe-audio-context/blob/master/index.js

instead. More soon.

On Tue, Feb 9, 2016 at 9:42 PM, Zhen Wang notifications@github.com
wrote:

Also was there a reason for choosing 2 audio channels for the offline
buffer? (Trying to reverse engineer why it works)


Reply to this email directly or view it on GitHub
#8 (comment).

Christopher Schaub
http://chris.schaub.com

Christopher Schaub
http://chris.schaub.com

@nehz
Copy link
Owner

nehz commented Feb 10, 2016

Yeah I agree, can't duplicate issue on my actual iPad either.
You can null out AudioContext before angular is loaded:

window.AudioContext = window.webkitAudioContext = null;

But I'll probably push an update that allows this via a flag

@nehz
Copy link
Owner

nehz commented Feb 12, 2016

Added flag to options to use HTML5 Audio cf8df07.
Also I added the safe-audio-context code to context init in case it helps some people (fingers crossed) 6b173f3.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants