Sign in to follow this  

OpenAL

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

Hello there, i am dealing with a simple (i guess) problem using 3D sound in my apps. The thing is that when i stop playing a sound i keep on hearing a really irritating sound coming from my speakers as like having a microphone close to them. I think the problem lies on not properly stopping the sound or not initializing something that is needed. Any ideas? Thank you The simplest version of code that also causes the problem when i call alSourceStop is the following: ALuint b,s; alutInit(NULL, NULL); alGenBuffers(1, &b); b = alutCreateBufferFromFile("0.wav"); alGenSources(1, &s); alSourcei(s, AL_BUFFER, b); alSourcePlay(s); alSourceStop(s); EDIT2: found what is causing the problem. If i stop a sound before it is being thoroughly played then this weird sound comes. The problem is though that some of my sounds are looped so i need to stop them at some point. any ideas? [Edited by - immuner on August 19, 2006 2:12:59 AM]

Share this post


Link to post
Share on other sites
nothing worked :(. the weird thing is that if i go step by step using breakpoints the sounds gets played and then it gets stopped without any problems only if i set the source gain to zero before stopping the sound.
But if i simply run the app and put a breakpoint right after the stopping of the sound then this weird noise comes back again.
has anyone come across this problem before? ive checked my drivers everything is being set up properly.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You probably want to stop using alutInit since it can cause major issues, take a look at DevMaster.net articles here at the bottom. Lesson 3 on I think uses the way it should be done now as alut is no longer maintained from my understanding.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Awesome, links don't work for AP, yes! Anyways, http://www.devmaster.net/articles.php copy and paste.

Share this post


Link to post
Share on other sites
thank you for your reply.

i forgot to mention it but indeed i have stopped using alutInit. Instead i am doing:
ALCcontext *pContext = NULL;
ALCdevice *pDevice = NULL;
pDevice = alcOpenDevice(NULL);
pContext = alcCreateContext(pDevice, NULL);
alcMakeContextCurrent(pContext);

which loads my default device properly. I generate the buffers but when i do
b = alutCreateBufferFromFile("0.wav"); b gets the value 0.

anyways i found a way around it. I do not stop the sound but i just set source gain to zero and i get no weird problems. Of course i do not stop the sound which i guess is the proper way to do it but it does the trick.

Share this post


Link to post
Share on other sites
Hello again,

i have a new question so i will ask it here. Does anyone know how can i load a wav file (using alut or since its deprecated now anything that would do) from a resource?

Thank you

Share this post


Link to post
Share on other sites

This topic is 4132 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this