全部,
我有一个播放 .aiff 文件的方法。在模拟器中一切正常,但是当我在设备上运行时,没有声音被渲染。我在我的设备上运行 iOS 7,它可以在模拟器中运行 iOS 7。
有任何想法吗?
这是方法:
-(void) playNote:(NSString *)noteVal {
AudioServicesDisposeSystemSoundID(soundId);
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef soundFileURLRef = CFBundleCopyResourceURL(mainBundle,(__bridge CFStringRef)noteVal, CFSTR("aiff"), NULL);
AudioServicesCreateSystemSoundID(soundFileURLRef, &soundId);
AudioServicesPlaySystemSound(soundId);
CFRelease(soundFileURLRef);
noteVal = nil;
}