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

WebAudio not loading on iOS safari #56

Open
Digital-Odyssey opened this issue Dec 12, 2017 · 9 comments
Open

WebAudio not loading on iOS safari #56

Digital-Odyssey opened this issue Dec 12, 2017 · 9 comments

Comments

@Digital-Odyssey
Copy link

Hey,

I can't get any audio to play on iOS devices. Does the "Audio Context Monkey Patch" code in hexi engine need to be updated?

@kittykatattack
Copy link
Owner

@PulsarMedia I'm not sure, are you getting any errors?
The repo for the sound module is here: https://github.com/kittykatattack/sound.js

@Digital-Odyssey
Copy link
Author

My game loads up and plays fine in iOS safari on my iPhone 6 but the audio doesn't work. And i am unable to determine if there are any errors since i can't run remote debugging on my Windows PC. My audio files are in MP3 format but i am not sure if they are compressed with low level complexity which apparently is what mobile safari supports - perhaps that could be the issue?

@kittykatattack
Copy link
Owner

I'm also not able to test this at the moment.
You could perhaps test a different sound engine, like howler just to see whether the problem is at the file level or the encoding level.

@Digital-Odyssey
Copy link
Author

Hi, i cant get my sound files to load with Howler - apparently it works primarily with WebM files.

Is there another library i cant test?

@kittykatattack
Copy link
Owner

@PulsarMedia Ok, that's weird!
HowlerJS plays everything.
I wonder if there's a problem with your sound files?
Have you tried this?

https://stackoverflow.com/a/18628124/1282216

@Digital-Odyssey
Copy link
Author

ok i tried a simple audio tag element and it looks like my audio file doesn't play on mobile devices. It plays if i load the file directly through the URL but not through code.

Do you have any recommendations on how to properly compress mp3 files for mobile?

@kittykatattack
Copy link
Owner

@PulsarMedia I'm really sorry, I haven't come across this problem before
Can anyone out there reading this offer some help??

@Digital-Odyssey
Copy link
Author

Actually nevermind about my previous post i was able to get my mp3 file to work on iOS safari through the audio tag just fine so there is nothing wrong with my mp3 file. I did however learn that safari on iOS does not autoplay audio files due to bandwidth concerns and that the Webaudio api requires a touchend event to activate audio on iOS mobile devices - im going to play around with this and see if i can get my audio to play through a touchend event.

@Digital-Odyssey
Copy link
Author

Do you happen to have any game demos with working audio on iOS safari? I tried adding a simple touched event to the window to load my audio but doesn't seem to work.

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

No branches or pull requests

2 participants