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

iOS no sound at all #18

Closed
innerdesign opened this issue Sep 15, 2016 · 10 comments
Closed

iOS no sound at all #18

innerdesign opened this issue Sep 15, 2016 · 10 comments

Comments

@innerdesign
Copy link

The latest iOS update seem to have broken this library; I'm using base64 encoding and I have no sound and no error.
Here the code I'm using:

Waud.init()
new WaudBase64Pack("sounds/sounds.json", sounds => {
    // to real Map(), no path, no extension
    game.sounds = new Map()
    for( let key in sounds.h ){ 
        let k = key.replace('sounds/','').replace(/\.(wav|mp3|ogg)$/gm,'')
        game.sounds.set( k, sounds.h[ key])
    }
})

then:
game.sounds.get('good').play()

@adireddy
Copy link
Member

I tested this morning on iPhone 6 iOS 10.0 (14A5346a) and it works fine.

Do you have the sample hosted somewhere so that I can test?

What device are you testing this on?

@adireddy
Copy link
Member

http://www.waudjs.com/ is using base64 sounds in the player section

and also this sample http://www.waudjs.com/sample/base64js.html

@adireddy
Copy link
Member

I just updated to iOS 10.0.1 and it's still working fine.

@innerdesign
Copy link
Author

We've tested on 3 iPads: iPad mini 2, the latest iPad Air, and an old one (can't tell what version).
Thinking of it, really not sure the old one as the latest iOS version... maybe it's chrome?

Will do a test page (but it's only the code I've provided) and get back when I have access to my test iPad mini later today...

@adireddy
Copy link
Member

ok. I have tested on safari. Will test on chrome as well just in case.

what's the audio format you are using?

@innerdesign
Copy link
Author

It's wav

@innerdesign
Copy link
Author

Here's the exact sounds and code I'm using:
http://s.codepen.io/zen-co/debug/PGNaZw

you should hear two sounds.

@adireddy
Copy link
Member

adireddy commented Sep 15, 2016

on iOS devices, you cannot play sounds without user interaction. You need to unlock audio before playing.

Here is the updated sample http://www.waudjs.com/sample/test.html

Touch anywhere on the screen to play audio.

More info here: https://github.com/waud/waud#usage

@innerdesign
Copy link
Author

Ah I see! I wasn't clear on that, or what the callback was for... Somehow automatically unlock audio on iOS devices didn't register as audio is automatically locked on iOS (unless triggered by touch)...

Will test later but I guess it should work now ;-)
Thanks.

@adireddy
Copy link
Member

👍

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

No branches or pull requests

2 participants