I searched the forum but couldn't get a great answer. I'm a real beginner to programming so this question is probably easily answered.
Code:
SystemSoundID ssid;
NSString *paths=[[NSBundle mainBundle]resourcePath];
NSString *audioFile=[paths stringByAppendingPathComponent :@"sound.caf"];
NSURL *audioURL=[NSURL fileURLWithPath:audioFile isDirectory:NO];
OSStatus error=AudioServicesCreateSystemSoundID((CFURLRef)audioURL, &ssid);
if(error){NSLog(@"Audio error");}
else{AudioServicesPlaySystemSound(ssid);}
This is the code snippet I'm using to generate sound, my sound is a 20 second caf file that I'd like to loop. How do I loop it? And can I pan it also? Is this a good way to implement sound in my app?
Thanks guys!