Jump to content
  • Advertisement
Sign in to follow this  
ifie

OpenAL sound state always set to AL_PLAYING?

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

Hey, trying to fix some code I run into a strange problem. Actually what I want to do is: simply stop all sounds playing and then later resume/restart them. Now as I can easily stop them all with alSoundStop(); I dont get them to start again. The line, that is starting them does the following: It first checks, whether the sound is playing... alGetSourcei(GameGlobals::SoundSource, AL_BUFFER, &buffer); if(buffer == GameGlobals::SoundBuffer[index]) { alGetSourcei(GameGlobals::SoundSource, AL_SOURCE_STATE, &state); if(state == AL_PLAYING) return true; } and if not it should do a alSOundPlay(). But now: whatever I try, it always states the sound being in state AL_PLAYING, so alSoundPlay is never executed, and thus nothing happens. I already tried to simply pause the sounds, but that doesnot do any diefference... What did not I understand??

Share this post


Link to post
Share on other sites
Advertisement
Can you post the code that stops your sounds (ie., calls alSourceStop)?

Also, the complete code for checking the sound state (alGetSource) and optionally playing it (alSourcePlay)?

Use [source] ... [/source] tags to format your code nicely.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!