Merge branch 'refs/heads/t/clean_server_exit'
[paraslash.git] / spx.h
1 /* Copyright (C) 2010 Andre Noll <maan@tuebingen.mpg.de>, see file COPYING. */
2
3 /**
4  *  \file spx.h Structures and prototypes common to the speex audio format
5  *  handler and the speex decoder.
6  */
7
8 /**
9  * Information extracted from the first ogg packet.
10  *
11  * It contains tech data but not the content of the attached comment tags.
12  */
13 struct spx_header_info {
14         /** Holds the state of the decoder. */
15         void *state;
16         /** Extracted from header. */
17         int frame_size;
18         /** Current sample rate in Hz. */
19         spx_int32_t sample_rate;
20         /** Current bitrate used by the decoder. */
21         int bitrate;
22         /** Number of frames per packet, extracted from header. */
23         int nframes;
24         /** The number of channels of the current stream. */
25         int channels;
26         /** Only needed for stereo streams. */
27         SpeexStereoState stereo;
28         /** Must be skipped during decode. */
29         int extra_headers;
30         /** Narrow/wide/ultrawide band, bitstream version. */
31         const SpeexMode *mode;
32 };
33
34 int spx_process_header(unsigned char *packet, long bytes,
35                 struct spx_header_info *shi);