Skip to content

Latest commit

 

History

History
80 lines (64 loc) · 3 KB

SDL_audio_c.h

File metadata and controls

80 lines (64 loc) · 3 KB
 
1
2
/*
Simple DirectMedia Layer
Jan 17, 2020
Jan 17, 2020
3
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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.
*/
Jan 6, 2017
Jan 6, 2017
21
22
23
24
#ifndef SDL_audio_c_h_
#define SDL_audio_c_h_
25
26
#include "../SDL_internal.h"
Nov 5, 2016
Nov 5, 2016
27
28
29
30
31
32
33
34
35
36
#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
37
38
/* Functions and variables exported from SDL_audio.c for SDL_sysaudio.c */
Jan 8, 2017
Jan 8, 2017
39
#ifdef HAVE_LIBSAMPLERATE_H
Jan 8, 2017
Jan 8, 2017
40
#include "samplerate.h"
Jan 8, 2017
Jan 8, 2017
41
extern SDL_bool SRC_available;
Jan 24, 2017
Jan 24, 2017
42
extern int SRC_converter;
Jan 8, 2017
Jan 8, 2017
43
44
45
46
47
48
49
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
50
51
52
53
54
/* 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 */
Jan 21, 2020
Jan 21, 2020
55
extern Uint8 SDL_SilenceValueForFormat(const SDL_AudioFormat format);
56
57
extern void SDL_CalculateAudioSpec(SDL_AudioSpec * spec);
Aug 29, 2017
Aug 29, 2017
58
59
60
61
/* Choose the audio filter functions below */
extern void SDL_ChooseAudioConverters(void);
/* These pointers get set during SDL_ChooseAudioConverters() to various SIMD implementations. */
Jan 16, 2017
Jan 16, 2017
62
63
64
65
66
67
68
69
70
71
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;
Sep 21, 2017
Sep 21, 2017
73
74
/* You need to call SDL_PrepareResampleFilter() before using the internal resampler.
SDL_AudioQuit() calls SDL_FreeResamplerFilter(), you should never call it yourself. */
Sep 21, 2017
Sep 21, 2017
75
76
extern int SDL_PrepareResampleFilter(void);
extern void SDL_FreeResampleFilter(void);
Sep 21, 2017
Sep 21, 2017
77
Sep 21, 2017
Sep 21, 2017
78
#endif /* SDL_audio_c_h_ */
Jan 6, 2017
Jan 6, 2017
79
80
/* vi: set ts=4 sw=4 expandtab: */