Original Post
Hello, I am using openAL with ogg vorbis for the sound in my engine, I wrote all of the classes and they compile fine, but when I run the alOpen() method the program crashes. Here is the class:
bool COpenALManager::alOpen(std::string alFileName)
{
//Open music file
if(!(oggFile = fopen(alFileName.c_str(), "rb")))
return false;
//Open stream
ov_open(oggFile, &oggStream, NULL, 0);
//Based on the number of channels the file has, format it accordingly
//to either mono (1) or stereo (2+)
if(vorbisInfo->channels == 1)
format = AL_FORMAT_MONO16;
else
format = AL_FORMAT_STEREO16;
//Set basic values for openAL
alGenBuffers(2, buffers);
alGenSources(1, &source);
*/
return true;
}
I call the method in main.cpp like so:
COpenALManager openalManager;
openalManager.alOpen("test.ogg");
Thank you for any help :)