MP3 Cue Points Article Updated on Adobe Developer Connection
I wrote a cue points article last year (October, 2006) for what was then called the Adobe Dev Center. One of the editors recently asked me to update that article for Flash CS3, which I was happy to do. It’s now available on the Adobe Developer Connection at the following URL.
http://www.adobe.com/devnet/actionscript/articles/cue_points_audio.html
If you’re looking for a way to assign cue points to audio files (especially MP3 files loaded at runtime), I hope you find this article useful. It steps through a custom SoundSync class in ActionScript 2.0 and 3.0.
December 7th, 2007 at 9:41 am
David,
You should really put some sort of paypal link on your site in case people want to donate to you. The information you provide on this blog is second to none and from the comments I have read, plus my personal experience, I’m sure people are very thankful, even to the point of donating to your blog, to keep it going.
Just a thought.
December 7th, 2007 at 11:20 am
Chad,
Hey, thanks for the thought! I take that as a compliment.
I’ve seen PayPal links on other tutorial blogs and sites. I certainly think it’s a reasonable idea — it never bothers me to see them — and I may do something like that at some point in the future … but I also think it’s good for the soul (my soul, anyway!) to be helpful without expecting anything in return.
Cheesy as it may sound, I enjoy making acquaintanceships by way of this blog and the Adobe forums, especially since I work from home. Answering questions keeps me in touch with the needs of people who do exactly the sorts of things I do, which gives me a sense of community. Sometimes I get stumped, too, which keeps me humble.
I do get contract work from people who visit this blog or who know me from the forums. I also get the occasional thankful reader who asks if I have an Amazon Wish List (and I do, here). I’m really glad to hear this blog has helped you!
December 7th, 2007 at 4:27 pm
David,
Thanks for the response. You sure can tell a lot about someone from their Amazon wish list huh?
The wish list is a great idea, thanks
January 7th, 2008 at 6:16 pm
Hi David -
First off, thanks for putting this tutorial together and for explaining how the code works so thoroughly. I am using this method in some eLearning I’m creating and it’s been a huge help.
I have run into a bug with the AS2.0 version of the code and am wondering if you’ve encountered it before. It happens pretty randomly, when a cue point event triggers, it triggers twice. I figured maybe it had something to do with the interval timer being too short, so I set _intervalDuration = 100; in the SoundSync.as file and that seems to be working so far.
I have also encountered another issue where if you set a cue point right near the beginning of the audio (like say 700 ms, the trigger never gets fired off. I work around that by never setting a cue point before the first second or two of audio, but I’d be interested to know if you’ve seen that behavior as well.
Ta,
Mark
January 10th, 2008 at 4:10 pm
Mark,
I’ve used this same code a number of times myself. What you’re describing does sound familiar. I do recall discovering the occasional weakness while using this class in actual projects. The good news is, I also remember managing to fix each issue as it came up, so I hope that provides some encouragement!
For what it’s worth, here’s a snippet from a change I made to the
pollCuePoints()method in one of my projects:I don’t know if that will help you at all — I fear it may not — but you’re certainly on the right track by tweaking
_intervalDuration. If the above snippet doesn’t change or correct the other issue, you may want to experiment with thespanvariable on your own. Those values work together and can probably stand to be tweaked for each situation. Which tells me I should have made them configurable.April 15th, 2008 at 3:38 pm
Hello David -
I just came across your tutorial for adding cue points to MP3 audio files - I wanted to think you for the excellent tutorial, it works great, and was exactly what I was needing.
An application I’m curently scoping uses both FLVs and MP3 files. I was wondering if you have come across any issues using the soundSync class with audio files in an app that also uses FLVPlayBack components with the usuall addASCuePoint for video?
Thanks in advance -
Michael
April 16th, 2008 at 12:16 am
Michael,
You shouldn’t run into any problems.
Each class instantiates its own distinct objects. Glad you like the
SoundSyncclass!August 6th, 2009 at 2:32 pm
Do you have a Play / Pause for the soundSync? Anything I use, it’s not working.
Or can you direct me to something that will work?
August 6th, 2009 at 2:56 pm
Dave,
SoundSyncextends the nativeSoundclass, so in theory, you’ll have to do whatever you would normally do with an instance ofSound. How are you trying to pause/play yourSoundSyncinstance?August 7th, 2009 at 8:40 am
Hi David,
When I use your sound stop and start functions with SoundSync, the pause doesn’t stay paused … it fires at the next cue point, even though the sound has stopped.
Any ideas why?
August 7th, 2009 at 8:48 am
Dave,
I’ll check this afternoon, if I get the chance. The way I wrote
SoundSync(if I remember it right!) subsequent cues shouldn’t fire under the circumstances you describe. This is due to a timer inside theSoundSyncclass that checks the current position of the sound itself: while paused, the position doesn’t change. Are you using the AS2 version, or the AS3 version?August 7th, 2009 at 8:50 am
I’m using AS2.
I really appreciated this!
August 7th, 2009 at 8:56 am
I should note that when I test my movie, everything works 100%, but when I simulate download when testing or once it’s up on the server, it fires. Hopefully there is something in that that will help you.