When trying to load a sound from file it successfully loads then spams the output with
Failed to open the audio device
An internal OpenAL call failed in SoundSource.cpp(37).
Expression:
alGenSources(1, &m_source)
Error description:
AL_INVALID_OPERATION
The specified operation is not allowed in the current state.
An internal OpenAL call failed in SoundSource.cpp(38).
Expression:
alSourcei(m_source, AL_BUFFER, 0)
Error description:
AL_INVALID_OPERATION
The specified operation is not allowed in the current state.
An internal OpenAL call failed in SoundBuffer.cpp(46).
Expression:
alGenBuffers(1, &m_buffer)
Error description:
AL_INVALID_OPERATION
The specified operation is not allowed in the current state.
Failed to open the audio device
An internal OpenAL call failed in SoundBuffer.cpp(265).
Expression:
alBufferData(m_buffer, format, &m_samples[0], size, sampleRate)
Error description:
AL_INVALID_OPERATION
The specified operation is not allowed in the current state.
etc.. etc.. until the program exits.
This is the simple test code I'm running
int main() {
sf::SoundBuffer test { };
if (test.loadFromFile("explosion.ogg")) {
sf::Sound test_sound { test };
test_sound.play();
}
}
Also note I'm running on Ubuntu 20.04.1 LTS using pulseaudio
I uninstalled pulseaudio and reinstalled it but the issue continues.
This problem doesnt occur when this is built out on windows so I'm not entirely sure what the issue is.