2011-10-05 84 views
0

我有一个应用程序,应该扮演3种不同的声音,我将它们定义为所以在我viewDidLoad中:声音没有在我的iOS应用程序中播放?

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"]], &notFoundSound); 

我提示他们,像这样玩:

AudioServicesPlaySystemSound(addedSound); 

他们在模拟器玩但不是在iPad上?在我的构建阶段下的复制包资源我看到他们列出,所以我认为他们应该把它作为我的应用程序的一部分 - 我在这里错过了什么?

+0

讨厌不言自明的,但你确认设备未设置为静音?这是一个愚蠢的事情,但我忘了检查一次,并敲了我的头几分钟... – isaac

+0

杜佩?您的声音太长:http://stackoverflow.com/questions/2014578/sound-on-simulator-but-not-device –

回答

0

我实际使用的解决方案在这个问题上提出的Tammenn,它为我工作很大: Sound on simulator but not device

+0

直接链接回答:http://stackoverflow.com/a/2014886/1431728。 – JohnK

相关问题