8 #include <flac/stream_decoder.h>
9 #if !defined(FLAC_API_VERSION_CURRENT) || (FLAC_API_VERSION_CURRENT < 8)
10 #define NEED_EASYFLAC 1
13 #include <OggFLAC/stream_decoder.h>
19 EasyFLAC__StreamDecoder *decoder;
21 FLAC__StreamDecoder *decoder;
25 long totalsamples; /* per channel, of course */
27 FLAC__StreamMetadata *comments;
29 FILE *in; /* Cache the FILE pointer so the FLAC read callback can use it */
30 int eos; /* End of stream read */
33 /* Buffer for decoded audio */
34 float **buf; /* channels by buf_len array */
36 int buf_start; /* Offset to start of audio data */
37 int buf_fill; /* Number of bytes of audio data in buffer */
39 /* Buffer for input data we already read in the id phase */
40 unsigned char *oldbuf;
46 int flac_id(unsigned char *buf, int len);
47 int oggflac_id(unsigned char *buf, int len);
48 int flac_open(FILE *in, oe_enc_opt *opt, unsigned char *buf, int buflen);
49 void flac_close(void *);
51 long flac_read(void *, float **buffer, int samples);