I have two applications that use the audiotoolbox framework to play short mp3 files. The deployment target is: 4.0 And the Base SDK is: iOS 5.0 SDK
I have an iphone 4 with iOS 5.0 and an iPhone 3GS with iOS 5.0. Both of them are playing the sounds. A friend of mine that have iPad with iOS 4.3, can't play any of the sounds. And another friend with iPhone 4 with iOS 4.2 can't play the sounds as well. It looks like its something with the iOS but I don't really have any clue what is the real reason for it not to play.
Here is an example of my code for playing a file:
H. file (only relevant code):
#import <AudioToolbox/AudioToolbox.h>
SystemSoundID soundID1;
M. file (only relevant code):
@synthesize soundID1
- (IBAction)one:(id)sender
{ NSString *path = [[NSBundle mainBundle] pathForResource:@"1" ofType:@"mp3"];
AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath:path], &soundID1);
AudioServicesPlaySystemSound (soundID1);
}
- (void)dealloc { AudioServicesDisposeSystemSoundID (self.soundID1);}