Assuming that I’ve merged several audio files into a single audio file (thus using only a single HTTP request), can I split them up into several HTML5 audio objects on the client side with JavaScript and, if so, how? Also, if it is possible, would this have any advantages over multiple requests?
Assuming that I’ve merged several audio files into a single audio file (thus using
Share
So far, this is what I’ve found out…HTML5 Audio isn’t built for that. Numerous other problems arise with Safari too (see this question and its answers) However, the Web Audio API seems like it might do the trick. While it’s not fully supported yet, there are polyfills on github and support for the API is quickly becoming a reality. Games have already been made that utilize this API (see Field Runners)
I’ve also found some nice tutorials on how to use it – primarily at creativejs and html5rocks.
Lastly, I’ve found an excellent example of the API in use. (The sound in the example is very quiet, though. You might need to turn up your volume to hear it)