问题描述
我有一个音频文件,也就是4小时之久。我创建了一个非标准的球员来管理我的需求 - 工作正常,但你不求多1218万毫秒的位置计数的球员停止。如果你定位声音打1210万(几秒钟earlyear) - 饰演罚款,如果它countinues不改变由code中的地位,发挥,这是件好事,直到结束。我没有得到任何错误,或关于此类问题的任何信息。
I have an audio file which is 4 hours long. I created a standart player to manage my needs - works fine, but you dont seek more than 12180000 miliseconds in position count player stops. If you position the sound to play 12100000 (few seconds earlyear) - plays fine and if it countinues to play without changing the position by code, it is good till the end. I dont get any errors, or any kind of information regarding this kind of issue.
soundChannel = sound.play(12180000); // DOES NOT PLAY, NO ERRORS
soundChannel = sound.play(12100000); // PLAYS FINE, AND CONTINUES TO PLAY TILL THE END
- 声音满载,播放前。
所以,任何人有什么想法?
So anybody have any ideas?
推荐答案
这是有趣......我不能让它过去打12173943毫秒
。对我来说,它的工作原理了,这一确切的数字,但在这之后任何东西,也不会玩。我的猜测是闪光灯下发一定数量的内存的声音,这个数字在那里计算出的内存分配给该文件的最大数量。希望别人可以附和我使用由樽提供的MP3,这是我的测试code
this is interesting... I cannot get it to play past 12173943 milliseconds
. For me, it works up that that exact number, but anything after that, it won't play. My guess is flash allots a certain amount of memory for sounds and that number right there calculates to the maximum amount of memory allotted for that file. Hopefully someone else can chime in. I am using the MP3 provided by Rummer and this was my test code
import flash.media.*;
import flash.events.*;
import flash.net.*;
var channel:SoundChannel = new SoundChannel();
var sound:Sound = new Sound();
sound.load(new URLRequest("podcast.mp3"));
sound.addEventListener(Event.COMPLETE, soundLoaded);
sound.addEventListener(IOErrorEvent.IO_ERROR, onError);
function soundLoaded(e:Event):void
{
channel = sound.play(12173943);
}
function onError(e:IOErrorEvent):void
{
trace(e);
}
我在使用Flash CS5.5和出口闪存10.2。我会高度考虑拆分你的MP3段。第一次我的SWF装,闪光挂,因为有多大的MP3是一个不错的前10秒就播放。
I'm using Flash CS5.5 and exporting for flash 10.2. I would highly consider splitting your mp3s into sections. The first time my SWF loaded, flash hung for a good 10 seconds before it played because of how large the mp3 is.
===============的作品AS2版本
=============== AS2 version that works
var my_sound:Sound = new Sound();
my_sound.onLoad = function(success:Boolean)
{
if (success)
{
my_sound.start(12180);
}
};
my_sound.loadSound("podcast.mp3", true);
这篇关于闪光的ActionScript 3 - 寻音/播放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!