Fixed mp3 bitrate calculation.

CQTexperiment
vspader 2008-02-17 19:59:01 +00:00
parent 1503c2868f
commit 5434fe510b
2 changed files with 2 additions and 3 deletions

View File

@ -23,7 +23,7 @@
unsigned char _inputBuffer[INPUT_BUFFER_SIZE+MAD_BUFFER_GUARD];
unsigned char *_outputBuffer;
int _outputFrames;
int _fileSize;
long _fileSize;
id<CogSource> _source;

View File

@ -271,8 +271,7 @@
}
}
//Need to make sure this is correct
bitrate = (_fileSize - id3_length) / ((sampleRate/1000.0)/totalFrames);
bitrate = ((_fileSize - id3_length)/128) * (sampleRate/totalFrames);
mad_frame_finish (&frame);
mad_stream_finish (&stream);