tags:

views:

34

answers:

2

Hi,

I have a mp3 file and I would like to play it from one position and for a certain duration. I have first used the Sound class, the play method where I can specify the start but not the duration.

I have looked then at SoundEffect class where you can specify a duration and a startTime. However I do not know how to play it from a AS3 class not from MXML : there is a play method ... but I get no sound !! Help!

Thanks

A: 

You might be able to implement the duration logic yourself using a Timer object and then calling Stop on your Sound when the time elapses.

Parappa
Yes. I thought doing it like this but this may be not so occurate. Actually I want to split the mp3 file into n (short) chuncks (2s) and being able to play one of those at wish.I will try it. Thanks
tit
I just implemented it and this is not occurate at all. However I can put some silence in between sound chuncks for managing it, I guess. If someone has a solution with SoundEffect class or oher means ... Thanks
tit
Sorry it didn't work. I'd like to know the answer to this as well.
Parappa
A: 

You could do this using KitchenSync (http://kitchensynclib.googlecode.com) which provides control over sound files and code-based timing.

Check out the KSSoundController class

Mims H. Wright