[sdlsound] SDL_sound v2's internal mixer format...
tsm at accesscomm.ca
Tue Aug 10 11:08:46 EDT 2004
I accidentally sent that before I was ready, my apologies. Here's the
typedef union intfloat
/* Converts an int into a float with range [-1.0,1.0) */
float quickfloat(Uint16 val)
/* 2.0f: 01000000 00000000 00000000 00000000 b */
int main(int argc, char *argv)
for(n=0; n<3; n++)
printf("%5i -> %f\n",vals[n],quickfloat(vals[n]));
> From a conceptual point of view, it seems that float
> is the "proper" way of handling clipping.
True, it'll never clip, but that can actually be a problem; instead of
clipping, it loses accuracy.
> (As graphics have moved from int to float, I kind of expect audio to
> do the same.)
Actually, graphics are still integer. OpenGL can take floats(but it doesn't
have to), but it still renders to integers. The movement to floating-point
audio kind of already happened with formats like MP3.
More information about the sdlsound