-
Notifications
You must be signed in to change notification settings - Fork 4
/
audio.h
150 lines (133 loc) · 4.04 KB
/
audio.h
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
/*
* audio.h: Frontend Status Monitor plugin for the AUDIO Disk Recorder
*
* See the README file for copyright information and how to reach the author.
*
*/
#ifndef __FEMON_AUDIO_H
#define __FEMON_AUDIO_H
enum eAudioCodec {
AUDIO_CODEC_INVALID = -1,
AUDIO_CODEC_UNKNOWN,
AUDIO_CODEC_MPEG1_I,
AUDIO_CODEC_MPEG1_II,
AUDIO_CODEC_MPEG1_III,
AUDIO_CODEC_MPEG2_I,
AUDIO_CODEC_MPEG2_II,
AUDIO_CODEC_MPEG2_III,
AUDIO_CODEC_HEAAC,
AUDIO_CODEC_LATM
};
enum eAudioChannelMode {
AUDIO_CHANNEL_MODE_INVALID = -1,
AUDIO_CHANNEL_MODE_STEREO,
AUDIO_CHANNEL_MODE_JOINT_STEREO,
AUDIO_CHANNEL_MODE_DUAL,
AUDIO_CHANNEL_MODE_SINGLE
};
enum eAudioBitrate {
AUDIO_BITRATE_RESERVED = -3,
AUDIO_BITRATE_FREE = -2,
AUDIO_BITRATE_INVALID = -1
};
enum eAudioSamplingFrequency {
AUDIO_SAMPLING_FREQUENCY_RESERVED = -2,
AUDIO_SAMPLING_FREQUENCY_INVALID = -1
};
enum eAudioCenterMixLevel {
AUDIO_CENTER_MIX_LEVEL_INVALID = -1,
AUDIO_CENTER_MIX_LEVEL_MINUS_3dB,
AUDIO_CENTER_MIX_LEVEL_MINUS_4_5dB,
AUDIO_CENTER_MIX_LEVEL_MINUS_6dB,
AUDIO_CENTER_MIX_LEVEL_RESERVED
};
enum eAudioSurroundMixLevel {
AUDIO_SURROUND_MIX_LEVEL_INVALID = -1,
AUDIO_SURROUND_MIX_LEVEL_MINUS_3dB,
AUDIO_SURROUND_MIX_LEVEL_MINUS_6dB,
AUDIO_SURROUND_MIX_LEVEL_0_dB,
AUDIO_SURROUND_MIX_LEVEL_RESERVED
};
enum eAudioDolbySurroundMode {
AUDIO_DOLBY_SURROUND_MODE_INVALID = -1,
AUDIO_DOLBY_SURROUND_MODE_NOT_INDICATED,
AUDIO_DOLBY_SURROUND_MODE_NOT_DOLBYSURROUND,
AUDIO_DOLBY_SURROUND_MODE_DOLBYSURROUND,
AUDIO_DOLBY_SURROUND_MODE_RESERVED
};
enum eAudioBitstreamMode {
AUDIO_BITSTREAM_MODE_INVALID = -1,
AUDIO_BITSTREAM_MODE_CM,
AUDIO_BITSTREAM_MODE_ME,
AUDIO_BITSTREAM_MODE_VI,
AUDIO_BITSTREAM_MODE_HI,
AUDIO_BITSTREAM_MODE_D,
AUDIO_BITSTREAM_MODE_C,
AUDIO_BITSTREAM_MODE_E,
AUDIO_BITSTREAM_MODE_VO_KAR
};
enum eAudioCodingMode {
AUDIO_CODING_MODE_INVALID = -1,
AUDIO_CODING_MODE_1_1,
AUDIO_CODING_MODE_1_0,
AUDIO_CODING_MODE_2_0,
AUDIO_CODING_MODE_3_0,
AUDIO_CODING_MODE_2_1,
AUDIO_CODING_MODE_3_1,
AUDIO_CODING_MODE_2_2,
AUDIO_CODING_MODE_3_2,
};
typedef struct audio_info {
eAudioCodec codec; // enum
double bitrate; // bit/s or eAudioBitrate
int samplingFrequency; // Hz or eAudioSamplingFrequency
int channelMode; // eAudioChannelMode
} audio_info_t;
typedef struct ac3_info {
int bitrate; // bit/s or eAudioBitrate
int samplingFrequency; // Hz or eAudioSamplingFrequency
int bitstreamMode; // 0..7 or eAudioBitstreamMode
int audioCodingMode; // 0..7 or eAudioCodingMode
int dolbySurroundMode; // eAudioDolbySurroundMode
int centerMixLevel; // eAudioCenterMixLevel
int surroundMixLevel; // eAudioSurroundMixLevel
int dialogLevel; // -dB
bool lfe; // boolean
} ac3_info_t;
class cFemonAudioIf {
public:
cFemonAudioIf() {}
virtual ~cFemonAudioIf() {}
// enum
virtual void SetAudioCodec(eAudioCodec codecP) = 0;
// kbit/s or eAudioBitrate
virtual void SetAudioBitrate(double bitRateP) = 0;
// Hz or eAudioSamplingFrequency
virtual void SetAudioSamplingFrequency(int samplingP) = 0;
// eAudioChannelMode
virtual void SetAudioChannel(eAudioChannelMode modeP) = 0;
};
class cFemonAC3If {
public:
cFemonAC3If() {}
virtual ~cFemonAC3If() {}
// bit/s or eAudioBitrate
virtual void SetAC3Bitrate(int bitRateP) = 0;
// Hz or eAudioSamplingFrequency
virtual void SetAC3SamplingFrequency(int samplingP) = 0;
// 0..7 or eAudioBitstreamMode
virtual void SetAC3Bitstream(int modeP) = 0;
// 0..7 or eAudioCodingMode
virtual void SetAC3AudioCoding(int modeP) = 0;
// eAudioDolbySurroundMode
virtual void SetAC3DolbySurround(int modeP) = 0;
// eAudioCenterMixLevel
virtual void SetAC3CenterMix(int levelP) = 0;
// eAudioSurroundMixLevel
virtual void SetAC3SurroundMix(int levelP) = 0;
// -dB
virtual void SetAC3Dialog(int levelP) = 0;
// boolean
virtual void SetAC3LFE(bool onoffP) = 0;
};
#endif //__FEMON_AUDIO_H