Add Russian translation provided by Валерий Крувялис <valkru@mail.ru>
[xiph-mirror.git] / vorbis-tools / oggenc / flac.h
blob4b8635e4f810d69500295a105895e5db423a562d
2 #ifndef __FLAC_H
3 #define __FLAC_H
5 #include "encode.h"
6 #include "audio.h"
7 #include <stdio.h>
8 #include <FLAC/stream_decoder.h>
9 #if !defined(FLAC_API_VERSION_CURRENT) || (FLAC_API_VERSION_CURRENT < 8)
10 #define NEED_EASYFLAC 1
11 #endif
12 #if NEED_EASYFLAC
13 #include <OggFLAC/stream_decoder.h>
14 #include "easyflac.h"
15 #endif
17 typedef struct {
18 #if NEED_EASYFLAC
19 EasyFLAC__StreamDecoder *decoder;
20 #else
21 FLAC__StreamDecoder *decoder;
22 #endif
23 short channels;
24 int rate;
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 */
35 int buf_len;
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;
41 int oldbuf_len;
42 int oldbuf_start;
43 } flacfile;
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);
53 #endif /* __FLAC_H */