Mercurial > SDL_sound_CoreAudio
view mixer/DESIGN @ 562:7e08477b0fc1
MP3 decoder upgrade work.
Ripped out SMPEG and mpglib support, replaced it with "mpg123.c" and libmpg123.
libmpg123 is a much better version of mpglib, so it should solve all the
problems about MP3's not seeking, or most modern MP3's not playing at all,
etc. Since you no longer have to make a tradeoff with SMPEG for features, and
SMPEG is basically rotting, I removed it from the project.
There is still work to be done with libmpg123...there are MMX, 3DNow, SSE,
Altivec, etc decoders which we don't have enabled at the moment, and the
build system could use some work to make this compile more cleanly, etc.
Still: huge win.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Fri, 30 Jan 2009 02:44:47 -0500 |
parents | 859dd2ef3197 |
children |
line wrap: on
line source
- Mixes internally in Float32. This simplifies the code immensely by only having one format to screw with. It also makes life easy for end-user callbacks. A native Float32 format should be added to SDL, too, so there isn't unnecessary conversion if we can avoid it (i.e. - a CoreAudio backend). - "Chunks" are just Sound_Samples...you can lock the mixer to screw with them (i.e. - seeking in a playing Sample, etc). The mixer adds some opaque state to Sound_Sample (current play position, how much is decoded, etc), some of which can be queried and set. - There is no "stopped" state. You are either in the playing list or you are not, but state doesn't reset, so removing a sample from the list is more like pausing it. If you put it back in the playing list without rewinding it, it starts where it was. - Fire and forget mixing is easy; flag a sample as "auto free" and it'll delete itself when it's done playing. No need to set up a callback just to clean up. - No channels. You can mix as many samples as you have resources to accomodate. - No groups. This can be layered on top of the library if needed. If you need atomic operations, lock the mixer. - No music channel. Samples are samples. You can mix a MIDI as a sound effect if you want, or a WAV file for background music. If you have the horsepower to decode multiple compressed files at once, go for it. - You can prebuffer/predecode as much of a sample as you like. - Every sample mixes with a per-channel gain, plus a master gain that is global to the mixer. - Can handle non-power of two resampling. - post mix hook, sample finished hook. Effects callback?