PDA

View Full Version : AVFoundation framework




mahaboob
Sep 23, 2009, 08:48 AM
When I use the AVFoundation framework to play a sound(click sound, having only less than 1sec duration ), it just plays only 250 times. I tried it using the code given below

int i;
for(i=0;i<300;i++){

NSString *path = [[NSBundle mainBundle] pathForResource:@"click_off" ofType:@"wav"];
AVAudioPlayer *theAudio=[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
//theAudio.delegate = self;

NSLog(@"%d",i);
[theAudio play];

sleep(1);

}


Is there anything wrong with this?

Thank you in advance
mahaboob