I can’t figure it out.
I can play one sound with:
- (void) initSounds {
CFBundleRef mainBundle;
mainBundle = CFBundleGetMainBundle ();
soundFileURLRef = CFBundleCopyResourceURL (mainBundle,CFSTR ("1"),CFSTR ("wav"),NULL);
AudioServicesCreateSystemSoundID (soundFileURLRef, &soundFileObject);
}
-(void) play {
AudioServicesPlaySystemSound(self.soundFileObject);
}
But I want to create an array of SystemSoundID objects. When I try to do this, I keep getting errors. Can someone show me the code to create an array of soundFileObjects and how do I use this array in AudioServicesPlaySystemSound?
source
share