Differences in implementation across hosting platforms

Continuing the discussion from Hosting IFCOMP entry on Itch.Io:

This is a question I should probably post to its own thread (edit: I just created its own thread), but it is related to hosting platforms, so bear with me.

I have the same zipped archive posted to IF comp and to a restricted itch page (to keep it private). I have tested it on both platforms. Not surprisingly, it works the same-with just one weird exception.

This is a Twine Sugarcube game with a number of audio assets. I’ve created a playlist composed of two short files (an .mp3 and .wav) which should already be cached before the playlist is created. Later when I call playlist “name” play, both files play, on every system I’ve tested except one.

itch.io plays only the first track when I play it on my iphone. Itch.io plays both tracks of the playlist on all other systems. The ifcomp hosting site plays it correctly on all systems, including my iPhone. So it’s just that combination of itch and iphone which drops the second track of the playlist.

Is it possible that the second song in the playlist isn’t caching correctly in this one instance? Is there a problem with creating a playlist with two different file formats? This really has me puzzled.

Could this be an auto play thing? I never managed to get the iPhone to auto play.

1 Like

This may be relevant. It sounds similar to your issue.

Audio Requires a User Gesture, Every Time

2 Likes

That’s probably it (ios security feature on safari). Not limited to Safari, also affects the interaction between itch.io and Chrome on the same phone. Still not sure why it works on the IFcomp server, with the same phone and browsers (and why some of the sound cues do work correctly in itch with Safari). May require adding some debugging code to my game and reuploading it to itch.io again. I’ll use the information in the article you provided and see if those solutions work.

1 Like

It’ll be to do with itch iframe. It does a whole bunch of magic to allow sounds at all. I wanted to setup the same thing for demos. My iframe didn’t do sound and it was slow. I think by default it can sometimes copy the framebuffer as part of the portal. I dumped out the itch magic settings and copied them. Low and behold, sound worked and full render performance. Autoplay still didn’t work on safari, so my guess is the itch magic spells do not bother with trying to get it working at all in safari.

2 Likes

What finally fixed it for me was changing all my sound files from .wav to .mp3 and adding a waitforaudio macro in the StoryInit. I noticed previously that all of the .mp3 files played in itch, but only one of the .wav files played in itch. But one of the .wav files DID already play on itch, so this is still a mystery.

And I’m not sure whether the waitforaudio actually does anything, because the delay on load is imperceptible, and when I added waitforaudio before converting the sound files to mp3, it did nothing.

While debugging all of this, I realized that my audio volume slider control doesn’t work on the iPhone. One step at a time I’m afraid.

2 Likes