10
10
PulseAudio is free software; you can redistribute it and/or modify
11
11
it under the terms of the GNU Lesser General Public License as published
12
by the Free Software Foundation; either version 2 of the License,
12
by the Free Software Foundation; either version 2.1 of the License,
13
13
or (at your option) any later version.
15
15
PulseAudio is distributed in the hope that it will be useful, but
51
52
* \li PA_SAMPLE_ULAW - 8 bit mu-Law.
52
53
* \li PA_SAMPLE_S32LE - Signed 32 bit integer PCM, little endian.
53
54
* \li PA_SAMPLE_S32BE - Signed 32 bit integer PCM, big endian.
55
* \li PA_SAMPLE_S24LE - Signed 24 bit integer PCM packed, little endian.
56
* \li PA_SAMPLE_S24BE - Signed 24 bit integer PCM packed, big endian.
57
* \li PA_SAMPLE_S24_32LE - Signed 24 bit integer PCM in LSB of 32 bit words, little endian.
58
* \li PA_SAMPLE_S24_32BE - Signed 24 bit integer PCM in LSB of 32 bit words, big endian.
55
60
* The floating point sample formats have the range from -1.0 to 1.0.
60
65
* \section rate_sec Sample Rates
62
* PulseAudio supports any sample rate between 1 Hz and 4 GHz. There is no
67
* PulseAudio supports any sample rate between 1 Hz and 192000 Hz. There is no
63
68
* point trying to exceed the sample rate of the output device though as the
64
69
* signal will only get downsampled, consuming CPU on the machine running the
67
72
* \section chan_sec Channels
69
* PulseAudio supports up to 16 individiual channels. The order of the
74
* PulseAudio supports up to 32 individual channels. The order of the
70
75
* channels is up to the application, but they must be continous. To map
71
76
* channels to speakers, see \ref channelmap.
136
141
/**< Signed 16 Bit PCM, big endian */
138
143
PA_SAMPLE_FLOAT32LE,
139
/**< 32 Bit IEEE floating point, little endian, range -1 to 1 */
144
/**< 32 Bit IEEE floating point, little endian (PC), range -1.0 to 1.0 */
141
146
PA_SAMPLE_FLOAT32BE,
142
/**< 32 Bit IEEE floating point, big endian, range -1 to 1 */
147
/**< 32 Bit IEEE floating point, big endian, range -1.0 to 1.0 */
145
150
/**< Signed 32 Bit PCM, little endian (PC) */
148
/**< Signed 32 Bit PCM, big endian (PC) */
153
/**< Signed 32 Bit PCM, big endian */
156
/**< Signed 24 Bit PCM packed, little endian (PC). \since 0.9.15 */
159
/**< Signed 24 Bit PCM packed, big endian. \since 0.9.15 */
162
/**< Signed 24 Bit PCM in LSB of 32 Bit words, little endian (PC). \since 0.9.15 */
165
/**< Signed 24 Bit PCM in LSB of 32 Bit words, big endian. \since 0.9.15 */
151
168
/**< Upper limit of valid sample types */
161
178
#define PA_SAMPLE_FLOAT32NE PA_SAMPLE_FLOAT32BE
162
179
/** Signed 32 Bit PCM, native endian */
163
180
#define PA_SAMPLE_S32NE PA_SAMPLE_S32BE
181
/** Signed 24 Bit PCM packed, native endian. \since 0.9.15 */
182
#define PA_SAMPLE_S24NE PA_SAMPLE_S24BE
183
/** Signed 24 Bit PCM in LSB of 32 Bit words, native endian. \since 0.9.15 */
184
#define PA_SAMPLE_S24_32NE PA_SAMPLE_S24_32BE
164
186
/** Signed 16 Bit PCM reverse endian */
165
187
#define PA_SAMPLE_S16RE PA_SAMPLE_S16LE
166
188
/** 32 Bit IEEE floating point, reverse endian */
167
189
#define PA_SAMPLE_FLOAT32RE PA_SAMPLE_FLOAT32LE
168
/** Signed 32 Bit PCM reverse endian */
190
/** Signed 32 Bit PCM, reverse endian */
169
191
#define PA_SAMPLE_S32RE PA_SAMPLE_S32LE
192
/** Signed 24 Bit PCM, packed reverse endian. \since 0.9.15 */
193
#define PA_SAMPLE_S24RE PA_SAMPLE_S24LE
194
/** Signed 24 Bit PCM, in LSB of 32 Bit words, reverse endian. \since 0.9.15 */
195
#define PA_SAMPLE_S24_32RE PA_SAMPLE_S24_32LE
171
197
/** Signed 16 Bit PCM, native endian */
172
198
#define PA_SAMPLE_S16NE PA_SAMPLE_S16LE
174
200
#define PA_SAMPLE_FLOAT32NE PA_SAMPLE_FLOAT32LE
175
201
/** Signed 32 Bit PCM, native endian */
176
202
#define PA_SAMPLE_S32NE PA_SAMPLE_S32LE
177
/** Signed 16 Bit PCM reverse endian */
203
/** Signed 24 Bit PCM packed, native endian. \since 0.9.15 */
204
#define PA_SAMPLE_S24NE PA_SAMPLE_S24LE
205
/** Signed 24 Bit PCM in LSB of 32 Bit words, native endian. \since 0.9.15 */
206
#define PA_SAMPLE_S24_32NE PA_SAMPLE_S24_32LE
208
/** Signed 16 Bit PCM, reverse endian */
178
209
#define PA_SAMPLE_S16RE PA_SAMPLE_S16BE
179
210
/** 32 Bit IEEE floating point, reverse endian */
180
211
#define PA_SAMPLE_FLOAT32RE PA_SAMPLE_FLOAT32BE
181
/** Signed 32 Bit PCM reverse endian */
212
/** Signed 32 Bit PCM, reverse endian */
182
213
#define PA_SAMPLE_S32RE PA_SAMPLE_S32BE
214
/** Signed 24 Bit PCM, packed reverse endian. \since 0.9.15 */
215
#define PA_SAMPLE_S24RE PA_SAMPLE_S24BE
216
/** Signed 24 Bit PCM, in LSB of 32 Bit words, reverse endian. \since 0.9.15 */
217
#define PA_SAMPLE_S24_32RE PA_SAMPLE_S24_32BE
185
220
/** A Shortcut for PA_SAMPLE_FLOAT32NE */
186
221
#define PA_SAMPLE_FLOAT32 PA_SAMPLE_FLOAT32NE
188
223
/** \cond fulldocs */
189
/* Allow clients to check with #ifdef for thse sample formats */
224
/* Allow clients to check with #ifdef for these sample formats */
190
225
#define PA_SAMPLE_U8 PA_SAMPLE_U8
191
226
#define PA_SAMPLE_ALAW PA_SAMPLE_ALAW
192
227
#define PA_SAMPLE_ULAW PA_SAMPLE_ULAW
196
231
#define PA_SAMPLE_FLOAT32BE PA_SAMPLE_FLOAT32BE
197
232
#define PA_SAMPLE_S32LE PA_SAMPLE_S32LE
198
233
#define PA_SAMPLE_S32BE PA_SAMPLE_S32BE
234
#define PA_SAMPLE_S24LE PA_SAMPLE_S24LE
235
#define PA_SAMPLE_S24BE PA_SAMPLE_S24BE
236
#define PA_SAMPLE_S24_32LE PA_SAMPLE_S24_32LE
237
#define PA_SAMPLE_S24_32BE PA_SAMPLE_S24_32BE
201
240
/** A sample format and attribute specification */
222
261
/** Return the size of a sample with the specific sample type */
223
262
size_t pa_sample_size(const pa_sample_spec *spec) PA_GCC_PURE;
264
/** Similar to pa_sample_size() but take a sample format instead of a
265
* full sample spec. \since 0.9.15 */
266
size_t pa_sample_size_of_format(pa_sample_format_t f) PA_GCC_PURE;
225
268
/** Calculate the time the specified bytes take to play with the
226
269
* specified sample type. The return value will always be rounded
227
270
* down for non-integral return values. */