00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef LAME_GET_AUDIO_H
00024 #define LAME_GET_AUDIO_H
00025 #include "lame.h"
00026 #include <stdio.h>
00027
00028 typedef enum sound_file_format_e {
00029 sf_unknown,
00030 sf_raw,
00031 sf_wave,
00032 sf_aiff,
00033 sf_mp1,
00034 sf_mp2,
00035 sf_mp3,
00036 sf_mp123,
00037 sf_ogg
00038 } sound_file_format;
00039
00040 static int is_mpeg_file_format( int input_format )
00041 {
00042 switch ( input_format ) {
00043 case sf_mp1: return 1;
00044 case sf_mp2: return 2;
00045 case sf_mp3: return 3;
00046 case sf_mp123: return -1;
00047 default: break;
00048 }
00049 return 0;
00050 }
00051
00052
00053
00054 FILE *init_outfile(char *outPath, int decode);
00055 void init_infile(lame_global_flags *, char *inPath, int *enc_delay, int *enc_padding);
00056 void close_infile(void);
00057 int get_audio(lame_global_flags * const gfp, int buffer[2][1152]);
00058 int get_audio16(lame_global_flags * const gfp, short buffer[2][1152]);
00059 int WriteWaveHeader(FILE * const fp, const int pcmbytes,
00060 const int freq, const int channels, const int bits);
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074 int lame_decoder(lame_global_flags * gfp, FILE * outf, int skip, char *inPath, char *outPath,
00075 int *enc_delay, int *enc_padding);
00076
00077
00078
00079 void SwapBytesInWords(short *loc, int words);
00080
00081
00082
00083 #ifdef LIBSNDFILE
00084
00085 #include "sndfile.h"
00086
00087
00088 #else
00089
00090
00091
00092 #include "portableio.h"
00093
00094
00095 typedef struct blockAlign_struct {
00096 unsigned long offset;
00097 unsigned long blockSize;
00098 } blockAlign;
00099
00100 typedef struct IFF_AIFF_struct {
00101 short numChannels;
00102 unsigned long numSampleFrames;
00103 short sampleSize;
00104 double sampleRate;
00105 unsigned long sampleType;
00106 blockAlign blkAlgn;
00107 } IFF_AIFF;
00108
00109 extern int aiff_read_headers(FILE *, IFF_AIFF *);
00110 extern int aiff_seek_to_sound_data(FILE *);
00111 extern int aiff_write_headers(FILE *, IFF_AIFF *);
00112 extern int parse_wavheader(void);
00113 extern int parse_aiff(const char fn[]);
00114 extern void aiff_check(const char *, IFF_AIFF *, int *);
00115
00116
00117
00118 #endif
00119 #endif