OpenAL wont change the volume (gain) of any sound
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?
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?
Hard to say what the problem might be but checking alGetError is always a good way to start debugging problems like this.
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!
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| How do I misuse volume buttons? | jaber | 15 | 5,828 |
Aug 26, 2009 11:24 AM Last Post: Frank C. |
|
| How can I change the name of a project? | riruilo | 4 | 2,265 |
Jun 3, 2009 08:04 AM Last Post: riruilo |
|

