I'd like to be able to loop certain sections of a sample using c4. I'd also like to skip between loops without waiting for the current loop to end. So for example if I have the last bar looping and I'm halfway through and I want to skip to the first bar, it would do so without waiting for the last bar to end.
I was using "currentTime" and "touchesBegan" to try to set it up but I can't get it to work like I want it. I was reading around on stack overflow about it and it looks like I'm supposed to NSTimer? or some sort of callback or something? How can I do this?
Here's what I've got:
@implementation C4WorkSpace {
C4Sample *audioSample;
}
-(void)setup {
audioSample = [C4Sample sampleNamed:@"C4Loop.aif"];
[audioSample play];
}
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
audioSample.currentTime = 1.0f;
//NSTimer? wait some time and then ?
//callback? I don't know how to do that, but is that what I would do here?
}
@end