Jump to content
Search Community

MP3 rewind and fast forward using gotoSoundTime

404Assassin test
Moderator Tag

Recommended Posts

Attempting to use gotoSoundTime to rewind and fast forward an MP3 -

 

var rewindStepParam:int = 1;
currentTrackLoader = LoaderMax.getLoader(currentTrack);
while(currentTrackLoader.soundTime > 0) {
trace(currentTrackLoader.soundTime + '\n' + currentTrackLoader.duration);
currentTrackLoader.gotoSoundTime(currentTrackLoader.soundTime-rewindStepParam , true);
}

While this does work there's no audio queue which is what I was the effect I was aiming for. Hoping that someone may have some experience with this and can point me in the right direction. I was thinking of trying it with a timed loop to see if that would introduce the desired effect but if someone has a better idea....

 

Thanks in advance for any help!

Link to comment
Share on other sites

Wouldn't you know it, the answer was TweenMax :)

 

		
public function rewind ():void {
currentTrackLoader = LoaderMax.getLoader(currentTrack);
if((currentTrackLoader.soundTime + rewindStepParam) > 0) {
	trace(currentTrackLoader.soundTime + '\n' + currentTrackLoader.duration);
	currentTrackLoader.gotoSoundTime(currentTrackLoader.soundTime - rewindStepParam);
	TweenMax.delayedCall(.5, rewind);
}
}

This does the trick but if anyone has a better idea please share!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...