I'm trying to get OpenAL working on the IPhone and the wav file I have isn't loading.
Here's my Objective C++ code
Code:
bool LSound::load_sound( const char* path )
{
OSStatus err = noErr;
//Open a file
CFURLRef theURL = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault, (UInt8*)path, strlen(path), false);
if (theURL == NULL)
{
NSLog(@"File not Found!");
return false;
}
ExtAudioFileRef extRef = NULL;
err = ExtAudioFileOpenURL( theURL, &extRef );
if(err)
{
NSLog( @"Unable to load file! Error Code:%ld", err );
return false;
}
The error code ends up being reported as -43.
Also, am I barking up the wrong tree? I need a sound API for the iPhone that doesn't lag and can play sound effects and music. Is there a better route than OpenAL?