|
Size: 2834
Comment: content added (still incomplete)
|
Size: 3253
Comment: content added
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 82: | Line 82: |
| === 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)|| |
|
| Line 88: | Line 96: |
| ''You can add useful comments here'' | |
| Line 91: | Line 99: |
| .[[SDL_StructureRemoveSectionIfEmpty]] | .[[SDL_AudioCVT]] .[[SDL_AudioSpec]] |
| Line 94: | Line 103: |
| .[[SDL_FunctionLeaveSectionIfEmpty]] | .[[SDL_BuildAudioCVT]] .[[SDL_MixAudioFormat]] |
SDL_AudioFormat
A typedef that contains audio format data and flags.
Contents
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 09 08 07 06 05 04 03 02 01 00
OR it could look like this
Bit |
Meaning |
15 |
sample is signed if set |
12 |
sample is bigendian if set |
08 |
sample is float if set |
07-00 |
sample bit size |
Unspecified bits are always zero. There are macros in SDL 1.3 and later to query these bits.
Audio flags
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 flags
AUDIO_U8 |
unsigned 8-bit samples |
AUDIO_S8 |
signed 8-bit samples |
AUDIO_U16LSB |
unsigned 16-bit samples |
AUDIO_S16LSB |
signed 16-bit samples |
AUDIO_U16MSB |
as above, but big-endian byte order |
AUDIO_S16MSB |
as above, but big-endian byte order |
AUDIO_U16 |
AUDIO_U16LSB |
AUDIO_S16 |
AUDIO_S16LSB |
Defaults to LSB byte order.
int32 support
(New to SDL 1.3)
AUDIO_S32LSB |
32-bit integer samples |
AUDIO_S32MSB |
as above, but big-endian byte order |
AUDIO_S32 |
AUDIO_S32LSB |
float32 support
(New to SDL 1.3)
AUDIO_F32LSB |
32-bit floating point samples |
AUDIO_F32MSB |
as above, but big-endian byte order |
AUDIO_F32 |
AUDIO_F32LSB |
Native audio byte ordering
#if SDL_BYTEORDER == SDL_LIL_ENDIAN #define AUDIO_U16SYS AUDIO_U16LSB #define AUDIO_S16SYS AUDIO_S16LSB #define AUDIO_S32SYS AUDIO_S32LSB #define AUDIO_F32SYS AUDIO_F32LSB #else #define AUDIO_U16SYS AUDIO_U16MSB #define AUDIO_S16SYS AUDIO_S16MSB #define AUDIO_S32SYS AUDIO_S32MSB #define AUDIO_F32SYS AUDIO_F32MSB #endif
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) |
Code Examples
You can add your code example here
Remarks
You can add useful comments here
Related Structures
