google_pacman icon indicating copy to clipboard operation
google_pacman copied to clipboard

Port sound to HTML5

Open moonshine opened this issue 14 years ago • 7 comments

Is it possible to port Flash sound to HTML5 audio?

moonshine avatar May 23 '10 23:05 moonshine

It would be cool if someone has the know-how for this :)

macek avatar May 24 '10 02:05 macek

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 avatar May 24 '10 13:05 Varstahl

@Varstahl, the biggest benefit here is that sound would work in offline mode.

macek avatar May 24 '10 17:05 macek

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 :)

Varstahl avatar May 26 '10 14:05 Varstahl

Branch https://github.com/mcepl/google_pacman/tree/html5 of my fork has uncompressed resources from the .swf file, if it helps anybody.

mcepl avatar Apr 21 '15 16:04 mcepl

@mcepl thanks for linking your repository

macek avatar Apr 21 '15 19:04 macek

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.

ghost avatar Mar 19 '18 08:03 ghost