2004-06-08 23:54:24 +00:00
|
|
|
#ifndef foosamplehfoo
|
|
|
|
|
#define foosamplehfoo
|
|
|
|
|
|
|
|
|
|
#include <inttypes.h>
|
2004-06-23 23:17:30 +00:00
|
|
|
#include <sys/types.h>
|
2004-06-08 23:54:24 +00:00
|
|
|
|
2004-06-23 23:17:30 +00:00
|
|
|
enum pa_sample_format {
|
2004-06-29 16:48:37 +00:00
|
|
|
PA_SAMPLE_U8,
|
|
|
|
|
PA_SAMPLE_ALAW,
|
|
|
|
|
PA_SAMPLE_ULAW,
|
|
|
|
|
PA_SAMPLE_S16LE,
|
|
|
|
|
PA_SAMPLE_S16BE,
|
|
|
|
|
PA_SAMPLE_FLOAT32,
|
|
|
|
|
PA_SAMPLE_MAX
|
2004-06-08 23:54:24 +00:00
|
|
|
};
|
|
|
|
|
|
2004-07-02 18:47:03 +00:00
|
|
|
#ifdef WORDS_BIGENDIAN
|
|
|
|
|
#define PA_SAMPLE_S16NE PA_SAMPLE_S16BE
|
|
|
|
|
#else
|
2004-06-29 16:48:37 +00:00
|
|
|
#define PA_SAMPLE_S16NE PA_SAMPLE_S16LE
|
2004-07-02 18:47:03 +00:00
|
|
|
#endif
|
2004-06-08 23:54:24 +00:00
|
|
|
|
2004-06-23 23:17:30 +00:00
|
|
|
struct pa_sample_spec {
|
|
|
|
|
enum pa_sample_format format;
|
2004-06-08 23:54:24 +00:00
|
|
|
uint32_t rate;
|
2004-06-20 01:12:13 +00:00
|
|
|
uint8_t channels;
|
2004-06-08 23:54:24 +00:00
|
|
|
};
|
|
|
|
|
|
2004-07-02 18:47:03 +00:00
|
|
|
size_t pa_bytes_per_second(const struct pa_sample_spec *spec);
|
|
|
|
|
size_t pa_sample_size(const struct pa_sample_spec *spec);
|
|
|
|
|
uint32_t pa_samples_usec(size_t length, const struct pa_sample_spec *spec);
|
|
|
|
|
int pa_sample_spec_valid(const struct pa_sample_spec *spec);
|
2004-07-03 00:19:17 +00:00
|
|
|
int pa_sample_spec_equal(const struct pa_sample_spec*a, const struct pa_sample_spec*b);
|
2004-06-29 16:48:37 +00:00
|
|
|
|
2004-07-07 00:22:46 +00:00
|
|
|
|
|
|
|
|
#define PA_SAMPLE_SNPRINT_MAX_LENGTH 32
|
2004-07-03 23:35:12 +00:00
|
|
|
void pa_sample_snprint(char *s, size_t l, const struct pa_sample_spec *spec);
|
|
|
|
|
|
2004-06-08 23:54:24 +00:00
|
|
|
#endif
|