开发者

sounds are not being played in my iOS app?

I have an app that should play 3 distinct sounds and I define them as so in my ViewDidLoad:

AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"2357_02" ofType:@"m4a"]], &addedSound);
AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath:[[NSBundle mainBu开发者_JS百科ndle] pathForResource:@"2357_01" ofType:@"m4a"]], &updatedSound);
AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"notifier_12" ofType:@"m4a"]], &notFoundSound);

And I cue them to play like so:

AudioServicesPlaySystemSound(addedSound);

They play in the simulator but not on the ipad? In my Build Phases under Copy Bundle Resources I see them listed so I assumed that they should make it as part of my app - what am I missing here?


I actually used the solution suggested by Tammenn on this question and it worked great for me: Sound on simulator but not device

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜