SDL_audio_c.h
Go to the documentation of this file.
/*
Simple DirectMedia Layer
Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
#ifndef SDL_audio_c_h_
#define SDL_audio_c_h_
#include "../SDL_internal.h"
#ifndef DEBUG_CONVERT
#define DEBUG_CONVERT 0
#endif
#if DEBUG_CONVERT
#define LOG_DEBUG_CONVERT(from, to) fprintf(stderr, "Converting %s to %s.\n", from, to);
#else
#define LOG_DEBUG_CONVERT(from, to)
#endif
/* Functions and variables exported from SDL_audio.c for SDL_sysaudio.c */
#ifdef HAVE_LIBSAMPLERATE_H
#include "samplerate.h"
extern SDL_bool SRC_available;
extern int SRC_converter;
extern SRC_STATE* (*SRC_src_new)(int converter_type, int channels, int *error);
extern int (*SRC_src_process)(SRC_STATE *state, SRC_DATA *data);
extern int (*SRC_src_reset)(SRC_STATE *state);
extern SRC_STATE* (*SRC_src_delete)(SRC_STATE *state);
extern const char* (*SRC_src_strerror)(int error);
#endif
/* Functions to get a list of "close" audio formats */
extern SDL_AudioFormat SDL_FirstAudioFormat(SDL_AudioFormat format);
extern SDL_AudioFormat SDL_NextAudioFormat(void);
/* Function to calculate the size and silence for a SDL_AudioSpec */
extern void SDL_CalculateAudioSpec(SDL_AudioSpec * spec);
/* Choose the audio filter functions below */
extern void SDL_ChooseAudioConverters(void);
/* These pointers get set during SDL_ChooseAudioConverters() to various SIMD implementations. */
extern SDL_AudioFilter SDL_Convert_S8_to_F32;
extern SDL_AudioFilter SDL_Convert_U8_to_F32;
extern SDL_AudioFilter SDL_Convert_S16_to_F32;
extern SDL_AudioFilter SDL_Convert_U16_to_F32;
extern SDL_AudioFilter SDL_Convert_S32_to_F32;
extern SDL_AudioFilter SDL_Convert_F32_to_S8;
extern SDL_AudioFilter SDL_Convert_F32_to_U8;
extern SDL_AudioFilter SDL_Convert_F32_to_S16;
extern SDL_AudioFilter SDL_Convert_F32_to_U16;
extern SDL_AudioFilter SDL_Convert_F32_to_S32;
/* You need to call SDL_PrepareResampleFilter() before using the internal resampler.
SDL_AudioQuit() calls SDL_FreeResamplerFilter(), you should never call it yourself. */
extern int SDL_PrepareResampleFilter(void);
extern void SDL_FreeResampleFilter(void);
#endif /* SDL_audio_c_h_ */
/* vi: set ts=4 sw=4 expandtab: */
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1572
SDL_PrepareResampleFilter
int SDL_PrepareResampleFilter(void)
Definition: SDL_audiocvt.c:435
SDL_ChooseAudioConverters
void SDL_ChooseAudioConverters(void)
Definition: SDL_audiotypecvt.c:1386
SDL_Convert_F32_to_U16
SDL_AudioFilter SDL_Convert_F32_to_U16
Definition: SDL_audiotypecvt.c:60
SDL_Convert_S16_to_F32
SDL_AudioFilter SDL_Convert_S16_to_F32
Definition: SDL_audiotypecvt.c:54
SDL_NextAudioFormat
SDL_AudioFormat SDL_NextAudioFormat(void)
Definition: SDL_audio.c:1659
SDL_AudioSpec
Definition: SDL_audio.h:178
SDL_Convert_S8_to_F32
SDL_AudioFilter SDL_Convert_S8_to_F32
Definition: SDL_audiotypecvt.c:52
SDL_Convert_S32_to_F32
SDL_AudioFilter SDL_Convert_S32_to_F32
Definition: SDL_audiotypecvt.c:56
SDL_AudioFormat
Uint16 SDL_AudioFormat
Audio format flags.
Definition: SDL_audio.h:64
data
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: SDL_opengl.h:1974
SDL_Convert_U8_to_F32
SDL_AudioFilter SDL_Convert_U8_to_F32
Definition: SDL_audiotypecvt.c:53
SDL_Convert_F32_to_S8
SDL_AudioFilter SDL_Convert_F32_to_S8
Definition: SDL_audiotypecvt.c:57
spec
SDL_AudioSpec spec
Definition: loopwave.c:31
SDL_Convert_F32_to_S16
SDL_AudioFilter SDL_Convert_F32_to_S16
Definition: SDL_audiotypecvt.c:59
SDL_Convert_U16_to_F32
SDL_AudioFilter SDL_Convert_U16_to_F32
Definition: SDL_audiotypecvt.c:55
SDL_CalculateAudioSpec
void SDL_CalculateAudioSpec(SDL_AudioSpec *spec)
Definition: SDL_audio.c:1668
SDL_Convert_F32_to_U8
SDL_AudioFilter SDL_Convert_F32_to_U8
Definition: SDL_audiotypecvt.c:58
SDL_AudioFilter
void(* SDL_AudioFilter)(struct SDL_AudioCVT *cvt, SDL_AudioFormat format)
Definition: SDL_audio.h:193
state
struct xkb_state * state
Definition: SDL_waylandsym.h:113
SDL_Convert_F32_to_S32
SDL_AudioFilter SDL_Convert_F32_to_S32
Definition: SDL_audiotypecvt.c:61
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:161
SDL_FreeResampleFilter
void SDL_FreeResampleFilter(void)
Definition: SDL_audiocvt.c:464
SDL_FirstAudioFormat
SDL_AudioFormat SDL_FirstAudioFormat(SDL_AudioFormat format)
Definition: SDL_audio.c:1647