Wiki Page Content

Differences between revisions 7 and 8
Revision 7 as of 2009-12-20 04:23:59
Size: 3091
Editor: ip68-4-123-62
Comment: null
Revision 8 as of 2009-12-20 04:37:09
Size: 2930
Editor: SheenaSmith
Comment: content changed
Deletions are marked like this. Additions are marked like this.
Line 25: Line 25:
=== Audio flags === ||||audio format macros||
Line 37: Line 37:

=== A
udio format flags ===
||||audio format values||
Line 41: Line 40:
||AUDIO_S16LSB||signed 16-bit samples in little-endian order||
||AUDIO_S16MSB||signed 16-bit samples int big-endian byte order||
||AUDIO_S16LSB||signed 16-bit samples in little-endian byte order||
||AUDIO_S16MSB||signed 16-bit samples in big-endian byte order||
Line 44: Line 43:
||AUDIO_U16LSB||unsigned 16-bit samples in little-endian order|| ||AUDIO_U16LSB||unsigned 16-bit samples in little-endian byte order||
Line 49: Line 48:

===
int32 support ===
(New to SDL 1.3)
||AUDIO_S32LSB||32-bit integer samples||
||AUDIO_S32MSB||as above, but big-endian byte order||
||||int32 support (New to SDL 1.3)||
||AUDIO_S32LSB||32-bit integer samples in little-endian byte order||
||AUDIO_S32MSB||32-bit integer samples in big-endian byte order||
||AUDIO_S32SYS||32-bit integer samples in nati
ve byte order
Line 55: Line 53:

===
float32 support ===
(New to SDL 1.3)
||AUDIO_F32LSB||32-bit floating point samples||
||AUDIO_F32MSB||as above, but big-endian byte order||
||||float32 support (New to SDL 1.3)||
||AUDIO_F32LSB||32-bit floating point samples in little-endian byte order||
||AUDIO_F32MSB||32-bit floating point samples in big-endian byte order||
||AUDIO_F32SYS||32-bit floating point samples in nati
ve byte order
Line 62: Line 59:
=== Native audio byte ordering === native audio byte ordering
Line 72: Line 69:

=== Allow change flags ===
Which audio format changes are allowed when opening a device.
||SDL_AUDIO_ALLOW_FREQUENCY_CHANGE||0x00000001||
||SDL_AUDIO_ALLOW_FORMAT_CHANGE||0x00000002||
||SDL_AUDIO_ALLOW_CHANNELS_CHANGE||0x00000004||
||SDL_AUDIO_ALLOW_ANY_CHANGE||(SDL_AUDIO_ALLOW_FREQUENCY_CHANGE|SDL_AUDIO_ALLOW_FORMAT_CHANGE|SDL_AUDIO_ALLOW_CHANNELS_CHANGE)||

SDL_AudioFormat

A typedef that contains audio format data and flags.

Values

Bit Meanings

These are what the 16 bits in SDL_AudioFormat currently mean:

 +----------------------sample is signed if set
 |
 |        +----------sample is bigendian if set
 |        |
 |        |           +--sample is float if set
 |        |           |
 |        |           |  +--sample bit size---+
 |        |           |  |                    |
15 14 13 12 11 10  9  8  7  6  5  4  3  2  1  0 

Unspecified bits are always zero. There are macros in SDL 1.3 and later to query these bits.

audio format macros

SDL_AUDIO_MASK_BITSIZE

(0xFF)

SDL_AUDIO_MASK_DATATYPE

(1<<8)

SDL_AUDIO_MASK_ENDIAN

(1<<12)

SDL_AUDIO_MASK_SIGNED

(1<<15)

SDL_AUDIO_BITSIZE(x)

(x & SDL_AUDIO_MASK_BITSIZE)

SDL_AUDIO_ISFLOAT(x)

(x & SDL_AUDIO_MASK_DATATYPE)

SDL_AUDIO_ISBIGENDIAN(x)

(x & SDL_AUDIO_MASK_ENDIAN)

SDL_AUDIO_ISSIGNED(x)

(x & SDL_AUDIO_MASK_SIGNED)

SDL_AUDIO_ISINT(x)

(!SDL_AUDIO_ISFLOAT(x))

SDL_AUDIO_ISLITTLEENDIAN(x)

(!SDL_AUDIO_ISBIGENDIAN(x))

SDL_AUDIO_ISUNSIGNED(x)

(!SDL_AUDIO_ISSIGNED(x))

audio format values

AUDIO_S8

signed 8-bit samples

AUDIO_U8

unsigned 8-bit samples

AUDIO_S16LSB

signed 16-bit samples in little-endian byte order

AUDIO_S16MSB

signed 16-bit samples in big-endian byte order

AUDIO_S16SYS

signed 16-bit samples in native byte order

AUDIO_U16LSB

unsigned 16-bit samples in little-endian byte order

AUDIO_U16MSB

unsigned 16-bit samples in big-endian byte order

AUDIO_U16SYS

unsigned 16-bit samples in native byte order

AUDIO_U16

AUDIO_U16LSB

AUDIO_S16

AUDIO_S16LSB

int32 support (New to SDL 1.3)

AUDIO_S32LSB

32-bit integer samples in little-endian byte order

AUDIO_S32MSB

32-bit integer samples in big-endian byte order

||AUDIO_S32SYS||32-bit integer samples in native byte order

AUDIO_S32

AUDIO_S32LSB

float32 support (New to SDL 1.3)

AUDIO_F32LSB

32-bit floating point samples in little-endian byte order

AUDIO_F32MSB

32-bit floating point samples in big-endian byte order

||AUDIO_F32SYS||32-bit floating point samples in native byte order

AUDIO_F32

AUDIO_F32LSB

native audio byte ordering

#if SDL_BYTEORDER == SDL_LIL_ENDIAN
#define AUDIO_S32SYS AUDIO_S32LSB
#define AUDIO_F32SYS AUDIO_F32LSB
#else
#define AUDIO_S32SYS AUDIO_S32MSB
#define AUDIO_F32SYS AUDIO_F32MSB
#endif

Code Examples

You can add your code example here

Remarks

You can add useful comments here


CategoryEnum

None: SDL_AudioFormat (last edited 2015-01-02 21:21:14 by PhilippWiesemann)

(Page Info.)
Feedback
Please include your contact information if you'd like to receive a reply.
Submit