You need the sample-rate for the reconstruction process - the samples are converted to the frequency domain then squeezed down to the bitrate by losing data - on reconstruction it goes back the other way, so I am guessing Adobe may have forgotten this small detail and assumed everything was at 44.1kHz, hence the double speed for 22kHz and advancing the playback to 0.5 * length means the end because you have got half the amount of samples as expected. Oops.

The encoder has a sampling rate for the input - I guess if you vary this from the source files own samplerate, you will get up/downsampling. MPEG-1 specified 32, 44.1 & 48 kHz sampling rates, MPEG-2 added 8, 11.025, 12, 16, 22.5 & 24 kHz, so if you are outputting your WAV file at 44.1, but using 22kHz in your codec, it will "drop" samples before passing it through the compression process. I am not sure what happens if you give the codec a file with a sample-rate that differs from these values, but I could hazard a guess if it is an Adobe one :) I think the stored sample-rate is the one you used when compressing, not the one from the source you compressed.

Glen

Kerry Thompson wrote:
Glen Pike wrote:

At the end of the day, you still have to decode MP3's into WAV type
audio to play it back.

Yes. And the codec will interpolate to reconstruct the audio it squeezed out
in the lossy compression process. At a high bit rate, with high-quality
source, this can be quite accurate--good enough even for a symphony musician
like me with top-of-the-line playback equipment.

The codec will output 11, 22, 44 etc. based on
the audio sample rate the file was encoded with...

Ok, that's the part I was missing. The mp3 file must store information about
the original sample rate. I wonder what it does when it's compressing
another mp3? Does it read the original sample rate, which could be several
generations old?

Cordially,

Kerry Thompson

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



--

Glen Pike
01326 218440
www.glenpike.co.uk <http://www.glenpike.co.uk>

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to