Jump to content
  • Advertisement
Sign in to follow this  
hunpro

OpenAL: stereo then mono on same source

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

Hi, I'm wrapping OpenAL, and found a strange thing: if I play a stereo sound, then assinging the same soundsource to a mono sound, the mono plays ( alGetSourcei(source,AL_SOURCE_STATE,&state) -> state==AL_PLAYING), but there is only silence. If mono is first, or the second sound is a stereo too, then everything is ok. I played around a bit, looking all the alGetSourcef() alGetSourcefv() properties, they are the same for mono and stereo, of course, we talk about the same source. Finally I tried to create the OAL device in 'generic software' not in 'generic hardware'(second is default) - now it is working. I use OpenAL SDK 1.1 (summer 2007) with VS2005 - VC8. My testcode (how to format code): // removed error checking for more clear view ALuint source; alGenSources(1,&source); alSourcei(source,AL_BUFFER,stereobufferindex); // stereo buffer alSourcePlay(source); Sleep(4000); // no matter if we wait until sound stops // second buffer alSourceStop(source); alSourcei(source,AL_BUFFER,NULL); alSourcei(source,AL_BUFFER,monobufferindex); // mono buffer alSourcePlay(source); // nothing to hear // wait for sound.. Should I use software mode always? (think it's slower, but works..I hope ;) (BTW: this is not the first bug with the hardware renderer, once mono-ogg-streaming made funny stuff, repeating first second of playback.. reinstalling the same SDK has solved that..cool)

Share this post


Link to post
Share on other sites
Advertisement
Hi,

I experienced a very similar problem you described. Playing mono first, then stereo on a sound source works as expected, but if I try stereo, then mono, the mono plays in silence. No error messages, yet the source indicates that it is still playing....

Thanks for the tip to change the device to "Generic Software"..that did the trick for me...now everything is working as expected.

This is definitely a bug...i wasted a couple of hours trying to find out what the problem was.

Also using OpenAL SDK 1.1 (summer 2007) with VS2005

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!