summaryrefslogtreecommitdiffstats
path: root/arm-fm-22k/lib_src/eas_audioconst.h
blob: 1cfa404addd7cba7770b19be8ecf6c38467d6aeb (plain)
1
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/*----------------------------------------------------------------------------
 *
 * File: 
 * eas_audioconst.h
 *
 * Contents and purpose:
 * Defines audio constants related to the sample rate, bit size, etc.
 *
 *
 * Copyright Sonic Network Inc. 2005

 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 *----------------------------------------------------------------------------
 * Revision Control:
 *   $Revision: 82 $
 *   $Date: 2006-07-10 11:45:19 -0700 (Mon, 10 Jul 2006) $
 *----------------------------------------------------------------------------
*/

#ifndef _EAS_AUDIOCONST_H
#define _EAS_AUDIOCONST_H

/*----------------------------------------------------------------------------
 * These macros define the various characteristics of the defined sample rates
 *----------------------------------------------------------------------------
 * BUFFER_SIZE_IN_MONO_SAMPLES	size of buffer in samples
 * _OUTPUT_SAMPLE_RATE			compiled output sample rate
 * AUDIO_FRAME_LENGTH			length of an audio frame in 256ths of a millisecond
 * SYNTH_UPDATE_PERIOD_IN_BITS	length of an audio frame (2^x samples)
 *----------------------------------------------------------------------------
*/

#if	defined (_SAMPLE_RATE_8000)
#define BUFFER_SIZE_IN_MONO_SAMPLES		32
#define _OUTPUT_SAMPLE_RATE 			8000
#define AUDIO_FRAME_LENGTH				1024
#define SYNTH_UPDATE_PERIOD_IN_BITS		5

#elif defined (_SAMPLE_RATE_16000)
#define BUFFER_SIZE_IN_MONO_SAMPLES		64
#define _OUTPUT_SAMPLE_RATE				16000
#define AUDIO_FRAME_LENGTH				1024
#define SYNTH_UPDATE_PERIOD_IN_BITS		6

#elif defined (_SAMPLE_RATE_20000)
#define BUFFER_SIZE_IN_MONO_SAMPLES		128
#define _OUTPUT_SAMPLE_RATE				20000
#define AUDIO_FRAME_LENGTH				1638
#define SYNTH_UPDATE_PERIOD_IN_BITS		7

#elif defined (_SAMPLE_RATE_22050)
#define BUFFER_SIZE_IN_MONO_SAMPLES		128
#define _OUTPUT_SAMPLE_RATE				22050
#define AUDIO_FRAME_LENGTH				1486
#define SYNTH_UPDATE_PERIOD_IN_BITS		7

#elif defined (_SAMPLE_RATE_24000)
#define BUFFER_SIZE_IN_MONO_SAMPLES		128
#define _OUTPUT_SAMPLE_RATE				24000
#define AUDIO_FRAME_LENGTH				1365
#define SYNTH_UPDATE_PERIOD_IN_BITS		7

#elif defined (_SAMPLE_RATE_32000)
#define BUFFER_SIZE_IN_MONO_SAMPLES		128
#define _OUTPUT_SAMPLE_RATE				32000
#define AUDIO_FRAME_LENGTH				1024
#define SYNTH_UPDATE_PERIOD_IN_BITS		7

#elif defined (_SAMPLE_RATE_44100)
#define BUFFER_SIZE_IN_MONO_SAMPLES		256
#define _OUTPUT_SAMPLE_RATE				44100
#define AUDIO_FRAME_LENGTH				1486
#define SYNTH_UPDATE_PERIOD_IN_BITS		8

#elif defined (_SAMPLE_RATE_48000)
#define BUFFER_SIZE_IN_MONO_SAMPLES		256
#define _OUTPUT_SAMPLE_RATE				48000
#define AUDIO_FRAME_LENGTH				1365
#define SYNTH_UPDATE_PERIOD_IN_BITS		8

#else
#error "_SAMPLE_RATE_XXXXX must be defined to valid rate"
#endif

#endif /* #ifndef _EAS_AUDIOCONST_H */