]> code.delx.au - pulseaudio/blob - src/sample.h
cleanup
[pulseaudio] / src / sample.h
1 #ifndef foosamplehfoo
2 #define foosamplehfoo
3
4 #include <inttypes.h>
5
6 #include "memblock.h"
7
8 enum sample_format {
9 SAMPLE_U8,
10 SAMPLE_ALAW,
11 SAMPLE_ULAW,
12 SAMPLE_S16LE,
13 SAMPLE_S16BE,
14 SAMPLE_FLOAT32
15 };
16
17 #define SAMPLE_S16NE SAMPLE_S16LE
18
19 struct sample_spec {
20 enum sample_format format;
21 uint32_t rate;
22 uint32_t channels;
23 };
24
25 #define DEFAULT_SAMPLE_SPEC default_sample_spec
26
27 extern struct sample_spec default_sample_spec;
28
29 struct memblock *silence(struct memblock* b, struct sample_spec *spec);
30
31
32 struct mix_info {
33 struct memchunk chunk;
34 uint8_t volume;
35 void *userdata;
36 };
37
38 size_t mix_chunks(struct mix_info channels[], unsigned nchannels, void *data, size_t length, struct sample_spec *spec, uint8_t volume);
39
40 size_t bytes_per_second(struct sample_spec *spec);
41 size_t sample_size(struct sample_spec *spec);
42
43 #endif