I cannot for the life of me get an mp3 file to play using AVFoundation and it is driving me crazy. It's not that much code. The code will compile without problems and when I run it in the 2.2 Simulator, no sound comes out. Would someone mind posting a sample xcode project or some code that is confirmed to be working and plays a single audio file? I have no idea if this is my setup or what. I can play shorter system sounds just fine.
I'm just using this sample code:
I'm just using this sample code:
Code:
NSString *path = [[NSBundle mainBundle] pathForResource:@"dream" ofType:@"m4a"];
AVAudioPlayer* theAudio=[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
theAudio.delegate = self;
[theAudio play];