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"]], ¬FoundSound);
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
精彩评论