7 This file is part of polypaudio.
9 polypaudio is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published
11 by the Free Software Foundation; either version 2 of the License,
12 or (at your option) any later version.
14 polypaudio is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with polypaudio; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
26 #include <sys/types.h>
28 enum pa_sample_format {
39 #ifdef WORDS_BIGENDIAN
40 #define PA_SAMPLE_S16NE PA_SAMPLE_S16BE
41 #define PA_SAMPLE_FLOAT32NE PA_SAMPLE_FLOAT32BE
43 #define PA_SAMPLE_S16NE PA_SAMPLE_S16LE
44 #define PA_SAMPLE_FLOAT32NE PA_SAMPLE_FLOAT32LE
46 #define PA_SAMPLE_FLOAT32 PA_SAMPLE_FLOAT32NE
48 struct pa_sample_spec {
49 enum pa_sample_format format;
54 size_t pa_bytes_per_second(const struct pa_sample_spec *spec);
55 size_t pa_sample_size(const struct pa_sample_spec *spec);
56 uint32_t pa_samples_usec(size_t length, const struct pa_sample_spec *spec);
57 int pa_sample_spec_valid(const struct pa_sample_spec *spec);
58 int pa_sample_spec_equal(const struct pa_sample_spec*a, const struct pa_sample_spec*b);
61 #define PA_SAMPLE_SNPRINT_MAX_LENGTH 32
62 void pa_sample_snprint(char *s, size_t l, const struct pa_sample_spec *spec);