Hi all,
Sometimes I'm getting a "Failed to open the audio device" message on the console output when I run my application using SFML. After that message, the application crashes.
Source code lines of my app thatares using audio SFML commands are:
m_sound_buffer = new sf::SoundBuffer();
if(!m_sound_buffer->LoadFromFile(GetConfigFile()->GetDataPath() + "mig.ogg"))
{
return;
}
m__sound = new sf::Sound(*m_sound_buffer, true);
Console output:
Failed to open the audio device
An internal OpenAL call failed in soundbuffer.cpp (46) : AL_INVALID_OPERATION, t
he specified operation is not allowed in the current state
An internal OpenAL call failed in soundbuffer.cpp (300) : AL_INVALID_OPERATION,
the specified operation is not allowed in the current state
An internal OpenAL call failed in sound.cpp (51) : AL_INVALID_OPERATION, the spe
cified operation is not allowed in the current state
An internal OpenAL call failed in sound.cpp (53) : AL_INVALID_OPERATION, the spe
cified operation is not allowed in the current state
An internal OpenAL call failed in sound.cpp (54) : AL_INVALID_OPERATION, the spe
cified operation is not allowed in the current state
An internal OpenAL call failed in sound.cpp (55) : AL_INVALID_OPERATION, the spe
cified operation is not allowed in the current state
An internal OpenAL call failed in sound.cpp (56) : AL_INVALID_OPERATION, the spe
cified operation is not allowed in the current state
An internal OpenAL call failed in sound.cpp (57) : AL_INVALID_OPERATION, the spe
cified operation is not allowed in the current state
Stack frame:
openal32.dll!00b8c5eb()
[Frames below may be incorrect and/or missing, no symbols loaded for openal32.dll]
openal32.dll!00b8ba5c()
kernel32.dll!7c80b729()
Error message:
Unhandled exception at 0x00b8c5eb in app.exe: 0xC0000005: Access violation reading location 0x00000000.
I guess that application crashes because it can't initalize the audio device, but my application doesn't realize of the error and then tries to load the .ogg file. How could I know if my audio device is initalized properly or not??
Thanks!