summaryrefslogtreecommitdiff
path: root/third_party/resample/src/sndlibextra.h
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2007-04-07 14:53:15 +0000
committerBenny Prijono <bennylp@teluu.com>2007-04-07 14:53:15 +0000
commitca07a9833149d270d1e5b44cfa381ac6ac03e39c (patch)
tree0d1297c8326f76aec00e068795ed1505047c63a7 /third_party/resample/src/sndlibextra.h
parent81d1b2797aa3945c529d57f9ddf6179ec2b392a4 (diff)
Moved resample to third_party directory
git-svn-id: http://svn.pjsip.org/repos/pjproject/branches/split-3rd-party@1170 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'third_party/resample/src/sndlibextra.h')
-rw-r--r--third_party/resample/src/sndlibextra.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/third_party/resample/src/sndlibextra.h b/third_party/resample/src/sndlibextra.h
new file mode 100644
index 00000000..536ac72c
--- /dev/null
+++ b/third_party/resample/src/sndlibextra.h
@@ -0,0 +1,48 @@
+#include <endian.h> /* so that sndlib.h will get host byte-order right */
+#include <sndlib.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/* for creating, opening and closing files for sndlib I/O */
+int sndlib_create(char *, int, int, int, int, char *);
+int sndlib_open_read(char *);
+int sndlib_open_write(char *);
+int sndlib_close(int, int, int, int, int);
+
+/* for reading and writing headers */
+int sndlib_read_header(int);
+int sndlib_write_header(int, int, int, int, int, int, char *, int *);
+int sndlib_set_header_data_size(int, int, int);
+
+/* helper functions */
+int **sndlib_allocate_buffers(int, int);
+void sndlib_free_buffers(int **, int);
+
+
+/* some handy macros */
+
+#define IS_FLOAT_FORMAT(format) ( \
+ (format) == snd_32_float \
+ || (format) == snd_32_float_little_endian )
+
+#define NOT_A_SOUND_FILE(header_type) ( \
+ (header_type) == MUS_UNSUPPORTED \
+ || (header_type) == MUS_RAW )
+
+/* The header types that sndlib can write, as of sndlib-5.5. */
+#define WRITEABLE_HEADER_TYPE(type) ( \
+ (type) == MUS_AIFF \
+ || (type) == MUS_NEXT \
+ || (type) == MUS_RIFF \
+ || (type) == MUS_IRCAM )
+
+#define INVALID_DATA_FORMAT(format) ((format) < 1)
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif /* __cplusplus */
+