【发布时间】:2010-08-25 05:35:54
【问题描述】:
我的应用程序上有按钮并且有一个简短的声音效果,当用户点击按钮时,会播放简短的声音,但是如果有人听音乐,音乐就会停止!我该如何处理?播放音乐和我的效果,我使用 AudioToolbox 框架。 我阅读了苹果文档不适用于 AVFoundation.framework !由于某些原因,我无法更改我的代码! systemSoundID 有什么办法吗?
-(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);
}
【问题讨论】:
标签: iphone