setting loop start and end points

hi

i would like to be able to set the sample loop start and end points like in Macromedia Director. At the moment I am checking for current position and if it reaches my end point then I send it to the start point. But i think it would be nice to be able to set it like this

ofSoundPlayer mySound;
mySound.load(“beat.mp3”);
mySound.setLoopBounds(0.5f, 0.7f);
mySound.play();

thanks

enrike

Although I haven’t yet explored the sound classes, I can see this being very useful-- additionally, a project I am currently working on (using ofVideoPlayer) could also really use similar functionality (by percentage-- setLoopPoints(0.0, 0.2) and/or by frames setLoopPoints(0,200)…etc). I’m sure lots of people could benefit from something like this, when dealing both with audio and video files/streams.

J

For setting loop points in a sound file, you could extend the ofSoundPlayer to do this pretty easily.

Use the function FMOD_Channel_SetLoopPoints() to set the loop point in a similar way that the ofSoundPlayer is setting the looping to on or off. Keep track of the current loop points in the ofSoundPlayer class.

Download the FMOD SDK to find out more, the details are in the API manual.

hope that’s useful…

Yeah that’s something I am looking for. Does anybody know if this is available yet in the ofVideo class?

Peter

Yeah.
Sounds like a new thing.
Keep us posted.
Good luck.