Buggy OpenAL Code
I get EXC_BAD_ACCESS every time this runs.
It goes fine until it hits the return. For some reason outAFID is... broken? I've tested the code several times and I'm sure that the return statement is where is breaks. Any idea why?
Code:
-(AudioFileID)openAudioFile:(NSString*)filePath
{
AudioFileID outAFID;
NSURL * afUrl = [NSURL fileURLWithPath:filePath];
OSStatus result = AudioFileOpenURL((CFURLRef)afUrl, kAudioFileReadPermission, kAudioFileCAFType, &outAFID);
if (result != 0) NSLog(@"cannot openf file: %@",filePath);
return outAFID;
}
Make sure you are compiling in debug mode or the line numbers given to you by the debugger probably won't make a lot of sense.
Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
If I put NSLogs in between every line in that function they print fine, but any after the function is called don't work. Is there anything wrong with the code i posted or is there some other problem in my program?

