Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mahaboob

macrumors member
Original poster
Jul 10, 2008
31
0
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
Code:
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
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.