Log In  

After some googling, I figured out how to fix the sound for PICO-8 games on iOS. I wrote a small demo in this GitHub repo: https://github.com/nucleartide/fix-pico8-ios-sound

It might be that this is obvious to anyone who's experimented with PICO-8 on mobile... but lemme know what you think!

P#45878 2017-11-05 01:09 ( Edited 2017-11-05 06:09)

Ah ha! Well spotted, sir!

I just did a quick test on my iPhone 6 and there's sound...glorious sound!

I'm going to integrate it with my "Add to home screen" template setup and see how that goes.

Thanks for the insight into Safari...doesn't surprise me they have something like that baked in.

P#45896 2017-11-05 12:49 ( Edited 2017-11-05 17:49)

So as I dig in more to what you've written and trying to integrate it, finding out that I can't even simulate the click event.

I mean, the gist of what your script does it use the audioContext for the browser, but that's all just triggered by the onclick on the overlay. Doing a programmatic click() doesn't get the job done. Thought it might since we'd rather not have that "tap to load" page at all.

Any thoughts on how to get that onclick() to listen to a "fake" click? I've done some digging already but nothing has worked :(

P#45905 2017-11-05 19:37 ( Edited 2017-11-06 00:37)

Yeah it won't work with programmatic clicks, it has to be a real click/touch from the user. Sadly the "tap to load" is mandatory.

Check out https://paulbakaus.com/tutorials/html5/web-audio-on-ios/ for the reasoning. :)

P#45907 2017-11-05 21:14 ( Edited 2017-11-06 02:14)

It's not all bad though. If you browse the BBS on mobile, note that there's an overlay you have to tap before a game loads.

EDIT: Also you don't have to use the overlay in that script, feel free to customize with something prettier!

P#45908 2017-11-05 21:15 ( Edited 2017-11-06 02:24)

Bummer but just something we'll deal with. I've already tweaked that overlay to see how I can use it better. Maybe just a splash screen with game art? Or an ad? Could be anything...eitherway, happy have sound in the mobile web world :)

P#45921 2017-11-06 09:36 ( Edited 2017-11-06 14:36)
:: makz

It doesn't seem to work on iOS 10 and also only worked once for me on safari desktop :-( after that the game doesn't load at all.

EDIT: On every device I try, it loads only the first time and after that it's blank. Some people report it doesn't work on Android :-(

EDIT: My fault, I forgot to add fix-pico8-ios-sound.js to my game.manifest

P#46565 2017-11-21 22:34 ( Edited 2017-11-22 03:51)

Why doesn't the sound just start to work once the player taps the screen? Without needing the script. My game has touch controls and the first thing you do is tap/press through the title screen, but sound of course completely doesn't work on mobile.

Also, I am curious if any Android users know whether sound works for Pico-8 on there.

P#61473 2019-02-03 00:12

[Please log in to post a comment]

Follow Lexaloffle:        
Generated 2022-08-19 07:49:44 | 0.008s | Q:18