delay between two sounds in flash
i have a problem with sounds in flash. i hope anyone can help.
task: i want to create an audio sequence. there are 8 predefined sound-starting-points in the timeline. for each starting-point, the user can select wich sound is played (dropdown menu).
when the user made his choice for al开发者_JAVA百科l the 8 bars. actionscript should gather this information and create a fluid sequence of these 8 sounds. then there will be a "play" button available for the user to start the sequence. the sounds don't have to be synced to a button or so. there is time for actionscript to put the sequence together.
problem: when i put two sounds directly one after another in a movieclip, there is no delay between the sounds, which is exactly what i want, but i can not control which sound is played through actionscript.
when i use actionscript, there is a delay between the sounds. here is what i tried with as. this is placed in the frame where sound2 should start
if (_global.Sound2 == "Piano" { var SoundA:Sound = new Sound (); SoundA.attachSound("Piano.mp3"); SoundA.start(); }
the resulting delay is not always the same. when i publish the swf a few times, the delay is different each time.
i use flash 8
question: is there a solution within flash? if not: is it possible to export the playlist to another program where to user-selections a used to create a sequence without gaps between the sounds?
thanks in advance marc
The delay you're experiencing may be caused by the header data that is present in mp3 files. You could skip that part by doing sound.start(skip);
where 'skip' is the number of seconds that you need to skip (a number like 0.6 should do it).
The only weird part is that you're saying that the delay is not always the same, I wouldn't know how to fix that.
精彩评论