Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: An internal OpenAL call failed in SoundBuffer.cpp??  (Read 3254 times)

0 Members and 1 Guest are viewing this topic.

Student555

  • Guest
An internal OpenAL call failed in SoundBuffer.cpp??
« on: July 31, 2015, 10:48:24 am »

I keep getting this error message in the command prompt.
Code: [Select]
An internal OpenAL call failed in SoundBuffer.cpp(253): GL_INVALID_OPERATION, a numeric argument is out of range

The weird part is, is that the program still works. The sound plays as it should, but the error message still pops up which is annoying me.

I don't understand what the problem is. I did some research, but nothing came of it. Through out my program I have the following structure when dealing with sound.
Code: [Select]
class A
{

   private:
   sf::soundbuffer buffer
   sf::sound aSound;
}

Code: [Select]
if(!buffer.loadFromFile("sound.wav"))
   return -1;

aSound.setBuffer(buffer);

Code: [Select]
while(run)
{


while(gui.pollEvent(callback))
{
   if(callback.id == 1)
     aSound.play();

}

}

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: An internal OpenAL call failed in SoundBuffer.cpp??
« Reply #1 on: July 31, 2015, 11:12:01 am »
Please read this and adapt your code accordingly.

Make sure you're using the latest SFML revision (2.3.x branch on GitHub).
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Student555

  • Guest
Re: An internal OpenAL call failed in SoundBuffer.cpp??
« Reply #2 on: July 31, 2015, 07:35:48 pm »
I tried giving minimal code before. Guess that was not good enough so here is some more.

Code: [Select]
sf::SoundBuffer cSound_buff_Click;
sf::Sound cButton_Click;

if(!cSound_buff_Click.loadFromFile("Click.wav"))
std::cout << "Error! Could not load sound." << std::endl;


cButton_Click.setBuffer(cSound_buff_Click);


while(cRunning)
{
Window.clear();

sf::Event Event;
while(Window.pollEvent(Event))
{

switch(Event.type)
{
case sf::Event::Closed:
cRunning = false;
break;

case sf::Event::KeyPressed:
if(sf::Keyboard::isKeyPressed(sf::Keyboard::Escape))
cRunning = false;
break;

}

gui.handleEvent(Event);
}

tgui::Callback callback;
while(gui.pollCallback(callback))
{
if(callback.id == 1)
{
cButton_Click.play();
return 3;
}
}

gui.draw();
Window.draw(Line);
Window.draw(Line1);
Window.draw(Line2);
Window.draw(Line3);
Window.display();
}

return -1;
}




Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Re: An internal OpenAL call failed in SoundBuffer.cpp??
« Reply #3 on: July 31, 2015, 08:12:19 pm »
This is neither minimal nor complete. Complete meaning you need to give us everything needed to compile and run it. Minimal meaning you should remove anything that is not linked to the core issue.
SFML / OS X developer