PDA

Click to See Complete Forum and Search --> : Volume


jovton
Mar 8th, 2001, 11:01 AM
Anyone knows how to change the system volume?
I mean like in... the loudness... the output of the sound-card.
Need C++ code. Thanx.

jovton
Mar 9th, 2001, 07:57 AM
OK, anyone, here's my project.

See if you can find what's wrong.
Because it returns an error code at the call to mixerGetLineControls.

parksie
Mar 9th, 2001, 01:29 PM
if (MMSYSERR_NOERROR == rc) {
// Couldn't open the mixer.
}
Shouldn't this be !=?

jovton
Mar 12th, 2001, 12:58 AM
No, the mixer functions always return zero, if successful.
MMSYSERR_NOERROR = 0.
Soif (rc != 0)
{
// An error occured
}

parksie
Mar 12th, 2001, 12:10 PM
I know that, but your code assumes its an error if it returns 0 :rolleyes:

jovton
Mar 12th, 2001, 02:05 PM
You know what, I think I've attached the wrong project.
You are right Parksie.
What I meant was, if it returns zero, then there was no error.
If it returns something other than zero, there was an error.

It should be !=

parksie
Mar 12th, 2001, 02:29 PM
Yep. All the multimedia functions use 0 to signify no error :) So...if that's the wrong project...stick the real one on and I'll have a look :)

jovton
Mar 13th, 2001, 01:21 AM
Actually, that was the only thing that had to change.
Just the comparison, and there....
You got the right project.

But don't bother any further. I found a cool web site that has the answer.
I found some cool classes.
I just had to change some stuff because I'm not using MFC for my project. Just plain Win32 API's.
I used a console project just for a test. The real one is plain Win32.

Thanx 4 yer time anyway. I appreciate it.
Here is the link to the web site:
http://www.codeproject.com/audio/volumeclasses.asp:):):):):):):):D