dinsdag 13 mei 2008

flash plays mp3 files at wrong or double speed

I had a flash file loading an external mp3 file trough actionscript. This works perfectly in some flash players, but others might play the mp3 file at a wrong speed (double speed).
This problem never occured to me, but i have some friends experiencing this problem.

The reason for this problem is the encoding of the mp3 file.
Flash only supports mp3 files encoded at a multiple rate of 11.025, so you should only use mp3 files encoded at 11, 22, 44... bitrate, where 44 would cause the least of problems. Other bitrates will (in some players) play the sound at a wrong or double speed.

Strange Adobe never fixed this, since this problem never occured with older flash players.
Anyhow, this encoding thing should do the trick, and your sound will play perfectly.


here some testing results i found at drupal.org
there is also a patch offered so the flash can only play files at the correct speed.
-----
TESTFILES LOCATED AT: http://playlist-demo.drupalart.org

Constant Bitrate, 192 Kbps, 44100 Hz, Stereo [OK]

Constant Bitrate, 128 Kbps, 44100 Hz, Stereo [OK]

Constant Bitrate, 112 Kbps, 44100 Hz, Stereo [ stuttering start/finish]

Constant Bitrate, 96 Kbps, 44100 Hz, Stereo [ stuttering start]

Constant Bitrate, 64 Kbps, 44100 Hz, Mono [ stuttering start/finish]

Constant Bitrate, 128 Kbps, 32000 Hz, Stereo [plays at faster speed, stuttering start]

Constant Bitrate, 96 Kbps, 32000 Hz, Stereo [plays at faster speed, stuttering start]

Constant Bitrate, 96 Kbps, 24000 Hz, Stereo [plays at even faster speed, stuttering start]

Constant Bitrate, 96 Kbps, 22050 Hz, Stereo [stuttering start]

Constant Bitrate, 64 Kbps, 22050 Hz, Stereo [OK]

Constant Bitrate, 32 Kbps, 11025 Hz, Stereo [stuttering start/finish]

Variable Bitrate, 125-180 Kbps VBR [OK]
------
thanks to zirafa for these testing results
------

or you can always use a hammer...
Please leave your comments.

.