]> code.delx.au - pulseaudio/blob - src/sample.h
esound protocol
[pulseaudio] / src / sample.h
1 #ifndef foosamplehfoo
2 #define foosamplehfoo
3
4 #include <inttypes.h>
5 #include <sys/types.h>
6
7 enum pa_sample_format {
8 PA_SAMPLE_U8,
9 PA_SAMPLE_ALAW,
10 PA_SAMPLE_ULAW,
11 PA_SAMPLE_S16LE,
12 PA_SAMPLE_S16BE,
13 PA_SAMPLE_FLOAT32,
14 PA_SAMPLE_MAX
15 };
16
17 #define PA_SAMPLE_S16NE PA_SAMPLE_S16LE
18
19 struct pa_sample_spec {
20 enum pa_sample_format format;
21 uint32_t rate;
22 uint8_t channels;
23 };
24
25 size_t pa_bytes_per_second(struct pa_sample_spec *spec);
26 size_t pa_sample_size(struct pa_sample_spec *spec);
27 uint32_t pa_samples_usec(size_t length, struct pa_sample_spec *spec);
28
29 int pa_sample_spec_valid(struct pa_sample_spec *spec);
30
31 #endif