SDL  2.0
SDL_audio_c.h File Reference
#include "../SDL_internal.h"
+ Include dependency graph for SDL_audio_c.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DEBUG_CONVERT   0
#define LOG_DEBUG_CONVERT(from, to)

Functions

SDL_AudioFormat SDL_FirstAudioFormat (SDL_AudioFormat format)
SDL_AudioFormat SDL_NextAudioFormat (void)
void SDL_CalculateAudioSpec (SDL_AudioSpec *spec)
void SDL_ChooseAudioConverters (void)
int SDL_PrepareResampleFilter (void)
void SDL_FreeResampleFilter (void)

Variables

SDL_AudioFilter SDL_Convert_S8_to_F32
SDL_AudioFilter SDL_Convert_U8_to_F32
SDL_AudioFilter SDL_Convert_S16_to_F32
SDL_AudioFilter SDL_Convert_U16_to_F32
SDL_AudioFilter SDL_Convert_S32_to_F32
SDL_AudioFilter SDL_Convert_F32_to_S8
SDL_AudioFilter SDL_Convert_F32_to_U8
SDL_AudioFilter SDL_Convert_F32_to_S16
SDL_AudioFilter SDL_Convert_F32_to_U16
SDL_AudioFilter SDL_Convert_F32_to_S32

Macro Definition Documentation

#define DEBUG_CONVERT   0

Definition at line 28 of file SDL_audio_c.h.

Function Documentation

void SDL_CalculateAudioSpec ( SDL_AudioSpec spec)

Definition at line 1660 of file SDL_audio.c.

References AUDIO_U8, SDL_AudioSpec::channels, SDL_AudioSpec::format, SDL_AudioSpec::samples, SDL_AUDIO_BITSIZE, SDL_AudioSpec::silence, and SDL_AudioSpec::size.

Referenced by open_audio_device(), and prepare_audiospec().

{
switch (spec->format) {
case AUDIO_U8:
spec->silence = 0x80;
break;
default:
spec->silence = 0x00;
break;
}
spec->size = SDL_AUDIO_BITSIZE(spec->format) / 8;
spec->size *= spec->channels;
spec->size *= spec->samples;
}
void SDL_ChooseAudioConverters ( void  )

Definition at line 1387 of file SDL_audiotypecvt.c.

References SDL_assert, SDL_FALSE, SDL_HasNEON, SDL_HasSSE2, SDL_TRUE, and SET_CONVERTER_FUNCS.

Referenced by SDL_BuildAudioCVT().

{
static SDL_bool converters_chosen = SDL_FALSE;
if (converters_chosen) {
return;
}
#define SET_CONVERTER_FUNCS(fntype) \
SDL_Convert_S8_to_F32 = SDL_Convert_S8_to_F32_##fntype; \
SDL_Convert_U8_to_F32 = SDL_Convert_U8_to_F32_##fntype; \
SDL_Convert_S16_to_F32 = SDL_Convert_S16_to_F32_##fntype; \
SDL_Convert_U16_to_F32 = SDL_Convert_U16_to_F32_##fntype; \
SDL_Convert_S32_to_F32 = SDL_Convert_S32_to_F32_##fntype; \
SDL_Convert_F32_to_S8 = SDL_Convert_F32_to_S8_##fntype; \
SDL_Convert_F32_to_U8 = SDL_Convert_F32_to_U8_##fntype; \
SDL_Convert_F32_to_S16 = SDL_Convert_F32_to_S16_##fntype; \
SDL_Convert_F32_to_U16 = SDL_Convert_F32_to_U16_##fntype; \
SDL_Convert_F32_to_S32 = SDL_Convert_F32_to_S32_##fntype; \
converters_chosen = SDL_TRUE
#if HAVE_SSE2_INTRINSICS
if (SDL_HasSSE2()) {
return;
}
#endif
#if HAVE_NEON_INTRINSICS
if (SDL_HasNEON()) {
return;
}
#endif
#if NEED_SCALAR_CONVERTER_FALLBACKS
#endif
#undef SET_CONVERTER_FUNCS
SDL_assert(converters_chosen == SDL_TRUE);
}
SDL_AudioFormat SDL_FirstAudioFormat ( SDL_AudioFormat  format)

Definition at line 1639 of file SDL_audio.c.

References format_idx, NUM_FORMATS, and SDL_NextAudioFormat().

{
break;
}
}
}
SDL_AudioFormat SDL_NextAudioFormat ( void  )

Definition at line 1651 of file SDL_audio.c.

References format_idx, and NUM_FORMATS.

Referenced by SDL_FirstAudioFormat().

{
return 0;
}
}
int SDL_PrepareResampleFilter ( void  )

Variable Documentation

SDL_AudioFilter SDL_Convert_F32_to_S16

Definition at line 60 of file SDL_audiotypecvt.c.

Referenced by SDL_BuildAudioTypeCVTFromFloat().

SDL_AudioFilter SDL_Convert_F32_to_S32

Definition at line 62 of file SDL_audiotypecvt.c.

Referenced by SDL_BuildAudioTypeCVTFromFloat().

SDL_AudioFilter SDL_Convert_F32_to_S8

Definition at line 58 of file SDL_audiotypecvt.c.

Referenced by SDL_BuildAudioTypeCVTFromFloat().

SDL_AudioFilter SDL_Convert_F32_to_U16

Definition at line 61 of file SDL_audiotypecvt.c.

Referenced by SDL_BuildAudioTypeCVTFromFloat().

SDL_AudioFilter SDL_Convert_F32_to_U8

Definition at line 59 of file SDL_audiotypecvt.c.

Referenced by SDL_BuildAudioTypeCVTFromFloat().

SDL_AudioFilter SDL_Convert_S16_to_F32

Definition at line 55 of file SDL_audiotypecvt.c.

Referenced by SDL_BuildAudioTypeCVTToFloat().

SDL_AudioFilter SDL_Convert_S32_to_F32

Definition at line 57 of file SDL_audiotypecvt.c.

Referenced by SDL_BuildAudioTypeCVTToFloat().

SDL_AudioFilter SDL_Convert_S8_to_F32

Definition at line 53 of file SDL_audiotypecvt.c.

Referenced by SDL_BuildAudioTypeCVTToFloat().

SDL_AudioFilter SDL_Convert_U16_to_F32

Definition at line 56 of file SDL_audiotypecvt.c.

Referenced by SDL_BuildAudioTypeCVTToFloat().

SDL_AudioFilter SDL_Convert_U8_to_F32

Definition at line 54 of file SDL_audiotypecvt.c.

Referenced by SDL_BuildAudioTypeCVTToFloat().