-
Notifications
You must be signed in to change notification settings - Fork 605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hitting wall sound when loading #171
Comments
We need to preload and cache all the sounds, otherwise when we play a sound the first instance will play a second late. The Audio API has a 'preload' attribute that's designed to provide exactly this. However, when tested, this did not work across all browsers. So we chose to play all sounds at minimum volume upon page load. At a volume of just 1%, this didn't used to be audible. I think it's time that Blockly take another look at sounds and determine if there are better ways of preloading sounds in the majority of browsers. We will probably need to keep the hacky low-volume preload technique for IE, but at a minimum I'd expect that Chrome and FF should have proper preloading abilities. |
Did you try prefetch: https://3perf.com/blog/link-rels/ |
Yes, I remember that 'prefetch' did absolutely nothing in any browser when this code was written. But that was 2014, and it's now |
I pulled down the latest code as of 12/28, and I noticed that for maze, if I load a level from local storage, the "hitting wall" sound plays immediately even though I didn't go off the edge. This happens only when loading an already-completed puzzle from local storage, there's no sound when starting a level fresh. This may happen with other games as well.
I noticed the same problem at https://blockly.games/. I don't recall this problem with a build from a few months ago (like around September).
The text was updated successfully, but these errors were encountered: