kripken/emscripten — pull request #1386 by michaeljbishop (2013-07-15 22:52:39+00:00)
Title: Add support for `SDL_RWFromConstMem()` for .ogg files.

Added support for loading .ogg audio files using a combination of`SDL_RWFromConstMem()` + `Mix_LoadMUS/WAV_RW()`.

`SDL_RWFromConstMem()` now returns an opaque reference that corresponds
to a Javascript-side object which retains the information passed in.
The same for `SDL_RWFromFile()` but it saves different information.

When `Mix_LoadMUS/WAV_RW()` is called, it now expects a reference to
one of those Javascript-side objects and from it, either uses a
pre-loaded Audio, or reads bytes from the file-system to make one,
or uses the bytes originally passed into `SDL_RWFromConstMem()` to
create one.

Note that with this change you can now simply embed sound files in your
app, you do not need to preload them.