The opus audio format handler.
[paraslash.git] / opus_common.h
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..71923f119b10806ca6fb973dc66ea0179665edfc 100644 (file)
@@ -0,0 +1,21 @@
+/** Various bits stored in the header of an opus stream. */
+struct opus_header {
+       /** lower 4 bits of the version byte, must be 0. */
+       int version;
+       /** 1..255 */
+       int channels;
+       /** Number of bytes to skip from the beginning. */
+       int preskip;
+       /** Sample rate of the input stream, used by the audio format handler. */
+       ogg_uint32_t input_sample_rate;
+       /** In dB, should be zero whenever possible. */
+       int gain;
+       /** Number of logical streams (usually 1). */
+       int nb_streams;
+       /** Number of streams to decode as 2 channel streams. */
+       int nb_coupled;
+       /** Mapping from coded channels to output channels. */
+       unsigned char stream_map[255];
+};
+
+int opus_parse_header(const char *packet, int len, struct opus_header *h);