3
我似乎无法弄清楚。我该如何制作一组SystemSoundID
我可以打一个声音:
- (void) initSounds {
// Get the main bundle for the app
CFBundleRef mainBundle;
mainBundle = CFBundleGetMainBundle();
// Get the URL to the sound file to play
soundFileURLRef = CFBundleCopyResourceURL (mainBundle,CFSTR ("1"),CFSTR ("wav"),NULL);
// Create a system sound object representing the sound file
AudioServicesCreateSystemSoundID (soundFileURLRef, &soundFileObject);
}
-(void) play {
AudioServicesPlaySystemSound(self.soundFileObject);
}
但我想创建SystemSoundID对象的数组。当我尝试这样做时,我不断收到错误。任何人都可以向我展示创建一个soundFileObjects数组的代码,以及我如何在AudioServicesPlaySystemSound中使用该数组?
我贴使用对象[这里的备选答案] [1]。 [1]:http://stackoverflow.com/a/26701297/951349 – smileBot 2014-11-03 18:17:59