return 1;
}
-int wav_read(char* filename, struct WAV*wav)
+int wav_read(struct WAV*wav, char* filename)
{
FILE*fi = fopen(filename, "rb");
unsigned char b[16];
return 1;
}
-int wav_write(char*filename, struct WAV*wav)
+int wav_write(struct WAV*wav, char*filename)
{
FILE*fi = fopen(filename, "wb");
char*b="RIFFWAVEfmt \x10\0\0\0data";
unsigned int size;
};
-int wav_read(char* filename, struct WAV*wav);
-int wav_write(char*filename, struct WAV*wav);
+int wav_read(struct WAV*wav, char* filename);
+int wav_write(struct WAV*wav, char*filename);
void wav_print(struct WAV*wav);
int wav_convert2mono(struct WAV*src, struct WAV*dest, int rate);
unsigned blocksize = 1152;
int is_mp3 = 0;
- if(readWAV(filename, &wav)) {
+ if(wav_read(&wav, filename)) {
int t;
- convertWAV2mono(&wav, &wav2, 44100);
+ wav_convert2mono(&wav, &wav2, 44100);
samples = (U16*)wav2.data;
numsamples = wav2.size/2;
free(wav.data);
#include "../lib/rfxswf.h"
#include "../lib/log.h"
#include "../lib/args.h"
-#include "wav.h"
+#include "../lib/wav.h"
char * filename = 0;
char * outputname = "output.swf";
exit(1);
}
- if(!readWAV(filename, &wav))
+ if(!wav_read(&wav, filename))
{
msg("<fatal> Error reading %s", filename);
exit(1);
}
- convertWAV2mono(&wav,&wav2, samplerate);
- //printWAVInfo(&wav);
- //printWAVInfo(&wav2);
+ wav_convert2mono(&wav,&wav2, samplerate);
+ //wav_print(&wav);
+ //wav_print(&wav2);
samples = (U16*)wav2.data;
numsamples = wav2.size/2;