#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";
{"o", "output"},
{"r", "framerate"},
{"s", "samplerate"},
-{"b", "bitrate"},
{"d", "definesound"},
{"l", "loop"},
{"C", "cgi"},
samplerate = 44100;
else {
fprintf(stderr, "Invalid samplerate: %d\n", samplerate);
- fprintf(stderr, "Allowed values: 11025, 22050, 44100\n", samplerate);
+ fprintf(stderr, "Allowed values: 11025, 22050, 44100\n");
exit(1);
}
return 1;
printf("-o , --output <filename> Explicitly specify output file. (Otherwise, output will go to output.swf)\n");
printf("-r , --framerate <fps> Set file framerate to <fps> frames per second.\n");
printf("-s , --samplerate <sps> Set samplerate to <sps> frames per second (default: 11025).\n");
- printf("-b , --bitrate bps Set mp3 bitrate to <bps>.\n");
printf("-d , --definesound Generate a DefineSound tag instead of streaming sound.\n");
printf("-l , --loop n (Only used with -d)\n");
printf("-C , --cgi For use as CGI- prepend http header, write to stdout.\n");
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;
+#ifdef WORDS_BIGENDIAN
+ /* swap bytes */
+ for(t=0;t<numsamples;t++) {
+ samples[t] = (samples[t]>>8)&0xff | (samples[t]<<8)&0xff00;
+ }
+#endif
+
if(numsamples%blocksize != 0)
{
// apply padding, so that block is a multiple of blocksize