SoundManager 2 is an attempt at providing the sound API which Javascript has been missing. It's a Javascript library which wraps and extends Flash's sound capabilities, bringing cross-platform audio functionality to Javascript.
https://johnresig.com/blog/embedding-and-encoding-in-javascript/
This link is now broken.
about:
All of the game contents are embedded within the game script: This includes all game sprites and music.
This is an interesting feat and one that's possible to accomplish within your own code. Let's take a step through how this was done to understand how we can better use this within our own sites.