]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - spx.h
Add support for the speex codec.
[paraslash.git] / spx.h
diff --git a/spx.h b/spx.h
new file mode 100644 (file)
index 0000000..6ffa80e
--- /dev/null
+++ b/spx.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2010 Andre Noll <maan@systemlinux.org>
+ *
+ * Licensed under the GPL v2. For licencing details see COPYING.
+ */
+
+/**
+ *  \file spx.h Structures and prototypes common to the speex audio format
+ *  handler and the speex decoder.
+ */
+
+/**
+ * Information extracted from the first ogg packet.
+ *
+ * It contains tech data but not the content of the attached comment tags.
+ */
+struct spx_header_info {
+       /** Holds the state of the decoder. */
+       void *state;
+       /** Extracted from header. */
+       int frame_size;
+       /** Current sample rate in Hz. */
+       spx_int32_t sample_rate;
+       /** Current bitrate used by the decoder. */
+       int bitrate;
+       /** Number of frames per packet, extracted from header. */
+       int nframes;
+       /** The number of channels of the current stream. */
+       int channels;
+       /** Only needed for stereo streams. */
+       SpeexStereoState stereo;
+       /** Must be skipped during decode. */
+       int extra_headers;
+       /** Narrow/wide/ultrawide band, bitstream version. */
+       const SpeexMode *mode;
+};
+
+int spx_process_header(unsigned char *packet, long bytes,
+               struct spx_header_info *shi);
+int spx_ctl(void *state, int request, void *ptr);