OpenAL wont change the volume (gain) of any sound

Member
Posts: 43
Joined: 2009.10
Post: #1
I'm using OpenAL to manage my sounds and for whatever reason I can't seem to change the audio volume of any sounds in openAL. Here is the line of code I'll give it:

alSourcef(sourceID, AL_GAIN, volume);

If I set the variable volume to 0.0, I still hear it just as loudly. In fact any value I've given it between 0 and 1 has 0 affect. Whats particularly strange is if I do the same thing but for pitch, it does work:

alSourcef(sourceID, AL_PITCH, pitch);

Using that line of code changing the values of pitch will correctly affect the sounds. So why is that this code will modify pitch, but wont modify the volume? Is there some other parameter that would make it so that a volume of 0.0 would produce no effect at all?
Quote this message in a reply
Member
Posts: 446
Joined: 2002.09
Post: #2
Hard to say what the problem might be but checking alGetError is always a good way to start debugging problems like this.
Quote this message in a reply
Member
Posts: 43
Joined: 2009.10
Post: #3
I figured it out. Turned out there was a problem with how the sound wrapper I was building off of worked. Thanks for the help though!
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Question on how to change the image data of a texture on a continual basis Malarkey 12 5,674 Jan 21, 2010 03:32 AM
Last Post: godexsoft
  How do I misuse volume buttons? jaber 15 6,724 Aug 26, 2009 11:24 AM
Last Post: Frank C.
  How can I change the name of a project? riruilo 4 2,692 Jun 3, 2009 08:04 AM
Last Post: riruilo