Advertisement Jump to content


This topic is now archived and is closed to further replies.


A Problem with OpenAL and Ogg Vorbis

This topic is 5485 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

I have a pretty annoying problem. I used the tutorials at to create an ogg vorbis class for a demo. The problem is that in this function:
void COGG::EmptyQueue()
   int queued;

   alGetSourcei(source, AL_BUFFERS_QUEUED, &queued);

   while(queued-- > 0)
      ALuint buffer;

      alSourceUnqueueBuffers(source, 1, &buffer);
      if(alGetError() != AL_NO_ERROR)
         MessageBox(hWnd, "Unqueue error", "Error", MB_OK);
queued seems to be always below 0 on all computers (three computers) I''ve tried, and gives an infinte loop without the queued-- > 0 there. This happens even with a sound blaster live in my computer. Without a SBLive in the others, the following function seems to stuff up as processed is always below 0:
bool COGG::Update()
   int processed;
   bool active = true;

   alGetSourcei(source, AL_BUFFERS_PROCESSED, &processed);

   while(processed-- > 0)
      ALuint buffer;

      alSourceUnqueueBuffers(source, 1, &buffer);
      if(alGetError() != AL_NO_ERROR)
         MessageBox(hWnd, "Buffer Unqueue Error", "Error", MB_OK);

      active = Stream(buffer);

      alSourceQueueBuffers(source, 1, &buffer);
      if(alGetError() != AL_NO_ERROR)
         MessageBox(hWnd, "Buffer Queue Error", "Error", MB_OK);

   return active;
I changed while(processes--) to while(processes-- > 0) to avoid an infinite loop. I don''t know what alGetSourcei() means really and I''m totally stuck! I''m basically horrifically nervous as the thing is due in two days, can anyone help me? Thanks

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!