Friday, November 30, 2007

SoundChannel issue? mp3 issue? Event.SOUND_COMPLETE

I was making audio player that plays a random song after the song finishes.. and found out some weird issue.

well it drove me nuts because even though i had soundchannel object listen for Event.SOUND_COMPLETE, it didn't trigger the SOUND_COMPLETE when song finshed playing..

after bunch of errors and browsing through web, found out that... if you use mp3 it doesn't trigger...

or mp3 doesn't have end info? or i guess some sort of weird thing is going on with the format so flash cannot trigger SOUND_COMPLETE...

The moment I read this i tried the same function without any kind of re-write but replacing it with .aif file.

BINGO! it totally works! played random song.. ...I spent almost a day on this....
and now i guess i have to write extra code for checking the position and triggering that event manually.

1 comment:

Alex Brown said...

I have the same problem but only after changing the playback position of the track and then letting it finish. If the track plays through from beginning to end then SOUND_COMPLETE get sent.