2 * Get Audio routines include file
4 * Copyright (c) 1999 Albert L Faber
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
24 #ifndef LAME_GET_AUDIO_H
25 #define LAME_GET_AUDIO_H
33 typedef enum sound_file_format_e {
38 sf_mp1, /* MPEG Layer 1, aka mpg */
39 sf_mp2, /* MPEG Layer 2 */
40 sf_mp3, /* MPEG Layer 3 */
41 sf_mp123, /* MPEG Layer 1,2 or 3; whatever .mp3, .mp2, .mp1 or .mpg contains */
45 int is_mpeg_file_format( int input_format );
47 int init_infile(lame_t gfp, char const * inPath);
48 int samples_to_skip_at_start(void);
49 int samples_to_skip_at_end(void);
50 void close_infile(void);
51 int get_audio(lame_t gfp, int buffer[2][1152]);
52 int get_audio16(lame_t gfp, short buffer[2][1152]);
53 int get_audio_float(lame_t gfp, float buffer[2][1152]);
54 int get_audio_double(lame_t gfp, double buffer[2][1152]);
57 FILE *init_outfile(char const *outPath, int decode);
58 int WriteWaveHeader(FILE * const fp, int pcmbytes, int freq, int channels, int bits);
59 void put_audio16(FILE* outf, short Buffer[2][1152], int iread, int nch);
63 typedef struct AudioReader* AudioReader;
65 AudioReader ar_open(lame_t gfp, char const* inPath);
66 int ar_samplesToSkipAtStart(AudioReader ar);
67 int ar_samplesToSkipAtEnd(AudioReader ar);
68 void ar_close(AudioReader ar);
69 int ar_readInt(AudioReader ar, lame_t gfp, int buffer[2][1152]);
70 int ar_readShort(AudioReader ar, lame_t gfp, short buffer[2][1152]);
71 int ar_readFloat(AudioReader ar, lame_t gfp, float buffer[2][1152]);
74 typedef struct AudioWriter* AudioWriter;
76 AudioWriter aw_open(lame_t gfp, char const* outPath, int pcmbystes, int freq, int channels, int bits);
77 int aw_writeWaveHeader(AudioWriter aw);
78 int aw_write(AudioWriter aw, short buffer[2][1152], int n);
79 int aw_write(AudioWriter aw, float buffer[2][1152], int n);
83 extern size_t sizeOfOldTag(lame_t gf);
84 extern unsigned char* getOldTag(lame_t gf);
90 #endif /* ifndef LAME_GET_AUDIO_H */