google_pacman
google_pacman copied to clipboard
Port sound to HTML5
Is it possible to port Flash sound to HTML5 audio?
It would be cool if someone has the know-how for this :)
I think it can be done, but requires quite a bit of effort. I might look into that later, but seems slightly unnecessary overkill at the moment.
@Varstahl, the biggest benefit here is that sound would work in offline mode.
But sounds, through many ways, works fine in offline mode. Either "fixing" the directory for Flash, or using a tiny web server (there are a lot around for all platforms) to host just the pacman page to use offline.
Of course it would be a benefit, but what I was thinking about is that to do that we would need to dump/encode around a 50 or so waves, then incorporate them into HTML5, which as far as I know several browsers don't fully support, and then change all the code for sound to switch it from flash to html.
You can see it's a bit time consuming. Possible, but time consuming. That's all :)
Branch https://github.com/mcepl/google_pacman/tree/html5 of my fork has uncompressed resources from the .swf
file, if it helps anybody.
@mcepl thanks for linking your repository
I removed the flash player logic and added calls to the Web Audio API. The sound SWF file was replaced with in-line data in a separate JavaScript file, so it will work offline. One new line was added to index.html and about 10 new lines of code were added to pacman10-hp.3.js. Should I make a pull request? Is there any concern about putting the sound data in a JavaScript file? Thanks.