OpenAL: stereo then mono on same source

Started by
0 comments, last by ttkaminski 14 years, 11 months ago
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)
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

This topic is closed to new replies.

Advertisement