Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by dmen

I have all sounds included in my initial game class, so that they are being preloaded. And, in fact I see them in the network panel of dev tools in Chrome. Unlike images though, I see a lot of 206's - "partial content" and the sounds are not always playing.
And still nothing at all in Safari on Windows. Game just crashes with an error on line 13 of audio.js.
Is audio not actually 'preloaded' by impact's preloader? I mean is it simply started and the progress bar is not an actual indicator of preloading? If that's the case is there any way to actually wait for the audio to download before starting?

1 decade ago by dominic

The best you can do is to tell the browser to begin loading a sound file until the canplaythrough event can be called - meaning the sound file can be played without interruption, provided the download rate will not change.

Impact just listens to this canplaythrough event and then considers the file loaded. Sadly, browser still screw this up and can't actually play a sound file when requested to. Chrome was pretty good at that a few versions ago, but they made it worse again :(

Other than playing it and waiting for the ended event, you can't force the browser to load the whole sound file at once.

1 decade ago by dmen

OK, thanks much for the explanation Dominic.

1 decade ago by Joncom

I know this must sound redundant, but is there really no workaround for this? I understand that using Ajax a call can me made to load an external file and jQuery has callback functions that will only be called once the file is 100% loaded. Is audio just a special case?
Page 1 of 1
« first « previous next › last »