Jump to content
  • Advertisement
Sign in to follow this  
Outcast Orange

OpenAL alBufferData Error 40961

This topic is 2653 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

The specific error code is 40961
The comments on the left should give you all the information you need:


alutInit(NULL,0);
alGetError();
ALuint buffers[AL_NUM_BUFFERS];
alGenBuffers(AL_NUM_BUFFERS, buffers);
if ((AL_ERROR = alGetError()) != AL_NO_ERROR)
{
printf("alGenBuffers : %d", AL_ERROR);
return 0;
}
ALfloat SourcePos[] = {0.0,0.0,0.0};
ALfloat SourceVel[] = {0.0,0.0,0.0};
ALfloat SourceOri[] = {0.0,0.0,0.0};
ALfloat ListenerPos[] = {0.0,0.0,0.0};
ALfloat ListenerVel[] = {0.0,0.0,0.0};
ALfloat ListenerOri[] = {0.0,0.0,-1.0,0.0,1.0,0.0};
ALenum format;
ALvoid* data;
ALsizei size;
ALsizei freq;
ALboolean loop;
alutLoadWAVFile("Sound Effects/click2.wav", &format, &data, &size, &freq, &loop);
if ((AL_ERROR = alGetError()) != AL_NO_ERROR)
{
printf("alutLoadWAVFile Sound Effects/click2.wav : %d", AL_ERROR);
alDeleteBuffers(AL_NUM_BUFFERS, buffers);
return 0;
}
alBufferData(Buffers[0], format, data, size, freq); //Problem seems to become apparent here
if ((AL_ERROR = alGetError()) != AL_NO_ERROR)
{
printf("alBufferData buffer 0 : %d", AL_ERROR); //I'm getting this line as output
alDeleteBuffers(AL_NUM_BUFFERS, buffers);
return 0;
}
alutUnloadWAV(format, data, size, freq);
if ((AL_ERROR = alGetError()) != AL_NO_ERROR)
{
printf("alutUnloadWAV : %d", AL_ERROR);
alDeleteBuffers(AL_NUM_BUFFERS, buffers);
return 0;
}
alGenSources(AL_NUM_SOURCES, Sources);
if ((AL_ERROR = alGetError()) != AL_NO_ERROR)
{
printf("alGenSources : %d", AL_ERROR);
return 0;
}
for(int source = 0; source<=AL_NUM_SOURCES; source++)
{
alSourcei (Sources[source],AL_BUFFER,Buffers[source]);
if ((AL_ERROR = alGetError()) != AL_NO_ERROR)
{
printf("alSourcei : %d", AL_ERROR);
return 0;
}
alSourcef (Sources[source],AL_PITCH,1.0);
alSourcef (Sources[source],AL_GAIN,1.0);
alSourcefv(Sources[source],AL_POSITION,SourcePos);
alSourcefv(Sources[source],AL_VELOCITY,SourceVel);
alSourcefv(Sources[source],AL_DIRECTION,SourceOri);
alSourcei (Sources[source],AL_LOOPING,AL_FALSE);

}
alListenerfv(AL_POSITION,ListenerPos);
alListenerfv(AL_VELOCITY,ListenerVel);
alListenerfv(AL_ORIENTATION,ListenerOri);

I searched around before posting this and couldn't find any topic with this specific problem.

Anyone who has experienced this problem before or understands a solution, feel free to help out a beginner.
I'm terrible with debugging new libraries; thank you in advance for any help.

Share this post


Link to post
Share on other sites
Advertisement
Does anyone know where I might find the resources to solve this problem myself?


Is there a list perhaps of common OpenAL issues and solutions, or am I entirely out of luck?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!