【发布时间】:2011-11-02 22:39:12
【问题描述】:
我有一个应该播放 3 种不同声音的应用,我在 ViewDidLoad 中这样定义它们:
AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"2357_02" ofType:@"m4a"]], &addedSound);
AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"2357_01" ofType:@"m4a"]], &updatedSound);
AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"notifier_12" ofType:@"m4a"]], ¬FoundSound);
我提示他们这样玩:
AudioServicesPlaySystemSound(addedSound);
他们在模拟器上玩但不在 ipad 上玩?在 Copy Bundle Resources 下的 Build Phases 中,我看到它们已列出,因此我认为它们应该将其作为我的应用程序的一部分 - 我在这里缺少什么?
【问题讨论】:
-
不愿说出显而易见的事实,但您确定设备未设置为静音?这是一件愚蠢的事情,但我忘记检查一次并敲了几分钟的头......
-
欺骗?你的声音是不是太长了:stackoverflow.com/questions/2014578/…
标签: iphone objective-c ios ipad