小编use*_*734的帖子

如何创建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);
}
Run Code Online (Sandbox Code Playgroud)

但我想创建一个SystemSoundID对象数组.当我尝试这样做时,我不断收到错误.任何人都可以告诉我创建soundFileObjects数组的代码以及我如何在AudioServicesPlaySystemSound中使用该数组?

iphone xcode objective-c

3
推荐指数
1
解决办法
1642
查看次数

标签 统计

iphone ×1

objective-c ×1

xcode ×1