Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Embed mp3 in actionscript 3 doesn't work

I have a problem with actionscript 3, especially when using the embed tag. I have this code:

[Embed(source = "sound.mp3")]
private static var soundClip:Class;

...

var sound:Sound = (new soundClip()) as Sound;
trace(sound.length);

When I test the movie, I get the following output : 4501,923 Which is the sound.mp3 length in milliseconds. However, the original sound is 13.000 milliseconds.

How can that be possible, can anyone help me please?

Thank you.

like image 670
Manos Ppd Avatar asked Jul 25 '11 15:07

Manos Ppd


1 Answers

The Embed process implies a transcodification (made by the compiler), if the sound doesn't fit into the supported Flash Player Sound format you can get unexpected results, like shrunk length. Check that the sounds you embed is at 44100 Hz Stereo, that is the supported sampling rate that won't cause any issues.

Cheers!

like image 162
Joan Llenas Avatar answered Sep 18 '22 10:09

Joan Llenas