Skip to content

Latest commit

 

History

History
95 lines (78 loc) · 2.82 KB

alt_audio_convert.h

File metadata and controls

95 lines (78 loc) · 2.82 KB
 
May 20, 2002
May 20, 2002
1
/*
Jun 18, 2002
Jun 18, 2002
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
* Extended Audio Converter for SDL (Simple DirectMedia Layer)
* Copyright (C) 2002 Frank Ranostaj
* Institute of Applied Physik
* Johann Wolfgang Goethe-Universität
* Frankfurt am Main, Germany
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the Free
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Frank Ranostaj
* ranostaj@stud.uni-frankfurt.de
*
* (This code blatantly abducted for SDL_sound. Thanks, Frank! --ryan.)
*/
Jun 21, 2002
Jun 21, 2002
28
29
#ifndef _INCLUDE_AUDIO_CONVERT_H_
#define _INCLUDE_AUDIO_CONVERT_H_
May 20, 2002
May 20, 2002
30
31
32
#include "SDL_audio.h"
#define Sound_AI_Loop 0x2
Jun 21, 2002
Jun 21, 2002
33
#define _fsize 32
May 20, 2002
May 20, 2002
34
Jul 3, 2002
Jul 3, 2002
35
36
37
38
typedef struct{
Sint16 numerator;
Sint16 denominator;
} Fraction;
May 20, 2002
May 20, 2002
39
40
typedef struct{
Jun 21, 2002
Jun 21, 2002
41
Sint16 c[16][4*_fsize];
Jun 25, 2002
Jun 25, 2002
42
Uint8 incr[16];
Jul 3, 2002
Jul 3, 2002
43
Fraction ratio;
Jun 29, 2002
Jun 29, 2002
44
int mask;
May 20, 2002
May 20, 2002
45
46
47
} VarFilter;
typedef struct{
Jun 12, 2002
Jun 12, 2002
48
Uint8* buffer;
May 20, 2002
May 20, 2002
49
50
51
52
int mode;
VarFilter *filter;
} AdapterC;
Jul 3, 2002
Jul 3, 2002
53
54
typedef int (*Adapter) ( AdapterC Data, int length );
May 20, 2002
May 20, 2002
55
56
typedef struct{
VarFilter filter;
Sep 26, 2002
Sep 26, 2002
57
int filter_index;
Jul 3, 2002
Jul 3, 2002
58
Adapter adapter[32];
Jun 29, 2002
Jun 29, 2002
59
60
61
62
63
64
65
66
67
68
69
70
/* buffer must be len*len_mult(+len_add) big */
int len_mult;
int len_add;
double add;
/* the following elements are provided for compatibility: */
/* the size of the output is approx len*len_ratio */
double len_ratio;
Uint8* buf; /* input/output buffer */
int needed; /* 0 if nothing to be done, 1 otherwise */
int len; /* Length of the input */
int len_cvt; /* Length of converted audio buffer */
May 20, 2002
May 20, 2002
71
72
} Sound_AudioCVT;
Jun 29, 2002
Jun 29, 2002
73
#define SDL_SOUND_Loop 0x10
Jun 12, 2002
Jun 12, 2002
74
Sep 26, 2002
Sep 26, 2002
75
76
77
78
#ifndef SNDDECLSPEC
#define SNDDECLSPEC DECLSPEC
#endif
Jul 5, 2002
Jul 5, 2002
79
extern SNDDECLSPEC int Sound_ConvertAudio( Sound_AudioCVT *Data );
May 20, 2002
May 20, 2002
80
Sep 26, 2002
Sep 26, 2002
81
82
83
extern SNDDECLSPEC int Sound_AltConvertAudio( Sound_AudioCVT *Data,
Uint8* buffer, int length, int mode );
Jul 5, 2002
Jul 5, 2002
84
extern SNDDECLSPEC int Sound_BuildAudioCVT( Sound_AudioCVT *Data,
May 20, 2002
May 20, 2002
85
Uint16 src_format, Uint8 src_channels, int src_rate,
Sep 26, 2002
Sep 26, 2002
86
Uint16 dst_format, Uint8 dst_channels, int dst_rate, Uint32 bufsize );
Sep 26, 2002
Sep 26, 2002
87
88
89
90
91
92
extern SNDDECLSPEC int Sound_AltBuildAudioCVT( Sound_AudioCVT *Data,
SDL_AudioSpec src, SDL_AudioSpec dst );
extern SNDDECLSPEC int Sound_estimateBufferSize( Sound_AudioCVT *Data,
int length );
May 20, 2002
May 20, 2002
93
Jun 21, 2002
Jun 21, 2002
94
#endif /* _INCLUDE_AUDIO_CONVERT_H_ */