3 ms·
Cool! I have trouble remembering all the things to do, so I died a couple times from hypothermio. On Safari, it seems to try to load Ogg files, which doesn't
by dietrichepp 14y ago
Cool! I have trouble remembering all the things to do, so I died a couple times from hypothermio. On Safari, it seems to try to load Ogg files, which doesn't work. I also made an HTML5 game for Ludum Dare, but it was under the 48-hour solo rules. All my audio is encoded both as MP3 and as Vorbis, and I use audio.canPlayType() to choose the format.
http://moria.us/ludumdare/ld26/play/ http://moria.us/ludumdare/ld26/play/
- shmerl 14y agoIt's a shame Safari still doesn't support Ogg/Theora by default. But you can install a Quicktime add-on to fix that. See https://www.xiph.org/quicktime/ https://www.xiph.org/quicktime/
- dietrichepp 14y agoThat's really the least of your problems when writing cross-browser audio code, as I learned last weekend. You can't play an audio object a second time in Chrome without calling .load(), and you shouldn't call .load() in Firefox because it introduces delays. I spent way less time converting to both Vorbis and MP3 than I did trying to get the audio API to work in a sane way. I'm not planning on installing Vorbis for Quicktime, I'm happy without it. I still don't have satisfactory audio timing on Firefox and not only can I not figure out what is causing it, every demo I find for "low latency" audio has significant latency problems on Firefox. (Note: Theora is the video codec, Vorbis is audio. Safari and IE don't support Vorbis, Firefox doesn't support MP3, presumably due to licensing costs which I've heard estimated at $300k.)
- shmerl 14y agoSorry, that was a typo (not enough sleep :), I obviously meant Vorbis. But Safari doesn't support Theora for video either (and no VP8 as well). I'd say - stay away from such crippled browsers if you can.