Wednesday, June 11, 2008

Gotcha of The Day - Chipmunk / Double Speed mp3 Files In Flash

Apparently, on some versions of flash, an improperly encoded mp3 file is played at double speed and sounds like the chipmunks. I haven't heard the problem, but one of my clients ran into it.

The solution appears to be:

The Macromedia Flash player has a problem playing files that are encoded at a rate that is not a multiple of 11.025 kHz. This effect is sometimes called the "chipmunk" effect: the file is played at double speed. To avoid this, encode MP3's at 11.025 kHz 22.050 kHz or 44.100 kHz.

So there you have it - when you encode an mp3 file to play in a flash movie, make sure it's at one of the above rates.

The best news is that you can even fix the issue with lame:

To force Lame.exe to resample your input file at 44.1 kHz, add the following command line switch:

--resample 44.1

Update: You can process a whole directory of corrections by doing:

 mkdir 8khz
 mv *.mp3 8khz
 for f in 8khz/*.mp3; do echo $f;  lame --resample 11.025 $f  `basename $f`  ; done
 mv 8khz ~/trash

No comments:

Post a Comment