MaxMod Stream Format

support for the gba/nds sound library from www.maxmod.org

Moderator: eKid

Post Reply
digithree

MaxMod Stream Format

Post by digithree » Mon Mar 28, 2011 1:02 am

In the MaxMod streaming example the actual sample data is derived from the function sinLerp() which returns a "4.12 fixed point number with the range [-1, 1]". This implies that the stream data format is also in 4.12 fixed format.

My question is what is the format for raw sound data to be put in the stream? Is it signed or unsigned? Is it a fixed 4.12 number between -1 and 1 (or possibly between -15.999999999999 and 15.999999999999 which would logically be the minimum and maximum values for a signed 4.12 number)?

As an aside, if sinLerp and other trig functions return signed values in 4.12, shouldn't one of those bits (the most signifigant bit usually isn't it) be the sign bit? So shouldn't it be 3.12 or 4.11 for a signed number?

Thanks :)

elhobbs
Posts: 358
Joined: Thu Jul 02, 2009 1:19 pm

Re: MaxMod Stream Format

Post by elhobbs » Mon Mar 28, 2011 2:38 am

You assumed quite a bit there. Doesn't the sample indicate that it generates noise - nothing is implied by the data. The data should be in the format you specified as parameters - PCM stereo or mono, 8 or 16 bit, and it will play at the requested rate.

digithree

Re: MaxMod Stream Format

Post by digithree » Tue Mar 29, 2011 10:14 pm

I suppose that's logical. I'll stick to PCM format then.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests