I have attached an mp3 file as background music for my application. Although it works great, the problem is that it does not play the entire track, it just plays the first 32 seconds (mp3 file is 1:30 min).
Can anyone understand why?
I read here that perhaps the sound does not fit into the supported sound format of the player, but I do not think that the problem! The file is not so big, but maybe I'm wrong?
Any idea that is causing the problem? Or how to fix it? The code is fine, I'm sure of it (its pretty simple. Just built-in mp3, initialized the required variable and played the sound. Nothing unusual)
EDIT : mp3 encoded at 44100 kHz
EDIT Here is the code, just incase
package { import flash.display.Sprite; import flash.media.Sound; import flash.media.SoundChannel; public class BackgroundMusic extends Sprite { [Embed(source="swfs/bg.mp3")] private var BG:Class; public function BackgroundMusic() { var backgroundMusic:Sound = new BG(); backgroundMusic.play(); } } }
source share