【发布时间】:2012-08-29 08:27:32
【问题描述】:
我有一个使用 AudioToolbox/AudioServices 库播放音频通知的简短方法(为简洁起见,我删除了大部分功能代码):
- (IBAction)thatWasEasy:(id)sender {
NSBundle *mainBundle = [NSBundle mainBundle];
NSString *filePath = [mainBundle pathForResource:@"easy" ofType:@"mp3"];
NSURL *aFileURL = [NSURL fileURLWithPath:filePath isDirectory:NO];
SystemSoundID soundID;
AudioServicesCreateSystemSoundID((__bridge_retained CFURLRef)aFileURL, &soundID) ;
AudioServicesPlaySystemSound(soundID);
}
音频在模拟器以及 iPad 1 和 iPad 2 设备上正常播放,但在 iPad 3(Verizon LTE 版本)上听不到声音。我已经彻底检查了设备的声音设置,并将音频文件类型转换为 wav 和 caf,行为没有差异。
关于更深入地解决此问题的任何建议?不幸的是,我没有另一台 iPad 3 可供比较。感谢您的帮助!
【问题讨论】:
标签: objective-c audiotoolbox ipad-3