我在我的应用程序上有按钮,并有一个短暂的声音效果,当用户点击按钮,短暂的声音播放,但如果有人听音乐,音乐将停止!我该如何处理?播放音乐和我的效果,我使用AudioToolbox框架。 我读过苹果文档不适用于AVFoundation.framework!由于某些原因,我无法更改我的代码!有什么办法systemSoundID?播放短音后iPod音乐将停止播放!
-(void)soundType{
NSString *path = [NSString stringWithFormat:@"%@%@",[[NSBundle mainBundle] resourcePath], @"/type.wav"];
SystemSoundID soundID;
NSURL *filePath = [NSURL fileURLWithPath:path isDirectory:NO];
AudioServicesCreateSystemSoundID((CFURLRef)filePath, &soundID);
AudioServicesPlaySystemSound(soundID);
}
很棒:)谢谢。 – Momi 2010-08-25 11:30:11