在ActionScript3的嵌入式MP3将不通过一路玩 [英] embedded mp3 in actionscript3 won't play all the way through

查看:135
本文介绍了在ActionScript3的嵌入式MP3将不通过一路玩的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的嵌入式MP3文件作为背景音乐,我的应用程序。虽然它工作正常,但问题是,它并没有发挥全程跟踪,它只是起到了一个32秒它(MP3文件时1:30分)。

是否有人在这里有任何想法,为什么?

这里,也许声音没有按'吨适合为支持的闪存播放器的声音格式,但我不认为这就是问题所在!该文件是没有那么大,但也许我错了吗?

什么导致问题的任何想法?或如何解决呢?在code是很好,我确信这一点(它的pretty的简单,只需嵌入到MP3,初始化所需的变量,播放的声音,没什么特别的)

修改:在MP3是EN codeD在44100千赫

修改这里是code,只是柜面

 包
{
    进口flash.display.Sprite;
    进口flash.media.Sound;
    进口flash.media.SoundChannel;

    公共类BackgroundMusic扩展Sprite
    {
        [嵌入(来源=主权财富基金/ bg.mp3)]
        私人变种BG:类;

        公共职能BackgroundMusic()
        {
            VAR backgroundMusic:声音=新BG();
            backgroundMusic.play();
        }

    }
}
 

解决方案

正如前面提到的链接提示,这个问题确实与MP3文件本身。基本上,它太大了。因此,从44kHz的立体声32位减少到44kHz的立体声16位后,它工作得很好,而现在通过运行所有的方式。随着中说的有点怪异,我们不能嵌入高品质的MP3文件。我presume,这个问题将不会是一个问题加载(而非嵌入),但我没有测试过。如果有人在这里对如何解决这个问题,而不会降低MP3质量的想法,请分享

I embedded an mp3 file be used as background music for my app. Though it works fine, the problem is that it doesn't play the whole track, it just plays the first 32 seconds of it (the mp3 file is 1:30 min).

Does anyone here has any idea why?

I've read here that maybe the sound doesn't fit into the supported flash player sound format, but I don't think that's the problem! The file is not that big, but maybe I am wrong?

Any idea whats causing the problem? Or how to fix it? The code is fine, am sure of it (its pretty simple. Just embedded the mp3, initialized the required variable and played the sound. Nothing fancy)

EDIT: the mp3 is 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();
        }

    }
}

解决方案

As the aforementioned link suggests, the problem was indeed with the mp3 file itself. Basically it was too big. So after reducing it from 44kHz stereo 32 bit to 44kHz stereo 16 bit it worked fine, and now it runs all the way through. With that said its kinda weird that we can't embed higher quality mp3 files. I presume that this problem wouldn't be an issue with loading (rather than embedding) but I haven't tested it. If anyone here has an idea on how to fix this problem without reducing the quality of the mp3 please share

这篇关于在ActionScript3的嵌入式MP3将不通过一路玩的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆