summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/sndfile-util.h
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-05-26 00:05:28 +0200
committerLennart Poettering <lennart@poettering.net>2009-05-26 00:05:28 +0200
commit5c10b84e0f020de8a0d9f5adc6b0affbae4343cb (patch)
tree94ce7378484087092364ab362573e729c4d6cbaf /src/pulsecore/sndfile-util.h
parent759a9d0cc56c074567e0048fc0a1058bc179a101 (diff)
sndfile: big rework of libsndfile interfacing code
This adds proper channel map handling when reading/writing audio files. This allows surround .WAV files to be played with the right channel setup automatically. This also merges paplay into pacat and adds recording into formatted files to pacat.
Diffstat (limited to 'src/pulsecore/sndfile-util.h')
-rw-r--r--src/pulsecore/sndfile-util.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/pulsecore/sndfile-util.h b/src/pulsecore/sndfile-util.h
new file mode 100644
index 00000000..74021da1
--- /dev/null
+++ b/src/pulsecore/sndfile-util.h
@@ -0,0 +1,52 @@
+#ifndef foopulsecoresndfileutilhfoo
+#define foopulsecoresndfileutilhfoo
+
+/***
+ This file is part of PulseAudio.
+
+ Copyright 2009 Lennart Poettering
+
+ PulseAudio is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as published
+ by the Free Software Foundation; either version 2.1 of the License,
+ or (at your option) any later version.
+
+ PulseAudio is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with PulseAudio; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+ USA.
+***/
+
+#include <sndfile.h>
+
+#include <pulse/sample.h>
+#include <pulse/channelmap.h>
+#include <pulse/proplist.h>
+
+int pa_sndfile_read_sample_spec(SNDFILE *sf, pa_sample_spec *ss);
+int pa_sndfile_read_channel_map(SNDFILE *sf, pa_channel_map *cm);
+
+int pa_sndfile_write_sample_spec(SF_INFO *sfi, pa_sample_spec *ss);
+int pa_sndfile_write_channel_map(SNDFILE *sf, pa_channel_map *cm);
+
+void pa_sndfile_init_proplist(SNDFILE *sf, pa_proplist *p);
+
+typedef sf_count_t (*pa_sndfile_readf_t)(SNDFILE *sndfile, void *ptr, sf_count_t frames);
+typedef sf_count_t (*pa_sndfile_writef_t)(SNDFILE *sndfile, const void *ptr, sf_count_t frames);
+
+/* Returns NULL if sf_read_raw() shall be used */
+pa_sndfile_readf_t pa_sndfile_readf_function(const pa_sample_spec *ss);
+
+/* Returns NULL if sf_write_raw() shall be used */
+pa_sndfile_writef_t pa_sndfile_writef_function(const pa_sample_spec *ss);
+
+int pa_sndfile_format_from_string(const char *extension);
+
+void pa_sndfile_dump_formats(void);
+
+#endif