Results 1 to 8 of 8

Thread: Volume

  1. #1

    Thread Starter
    Hyperactive Member jovton's Avatar
    Join Date
    Nov 2000
    Location
    South Africa
    Posts
    266

    Volume

    Anyone knows how to change the system volume?
    I mean like in... the loudness... the output of the sound-card.
    Need C++ code. Thanx.
    Last edited by jovton; Mar 8th, 2001 at 12:31 PM.
    jovton

  2. #2

    Thread Starter
    Hyperactive Member jovton's Avatar
    Join Date
    Nov 2000
    Location
    South Africa
    Posts
    266
    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.
    Attached Files Attached Files
    jovton

  3. #3
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Code:
    if (MMSYSERR_NOERROR == rc) {
        // Couldn't open the mixer.
    }
    Shouldn't this be !=?
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  4. #4

    Thread Starter
    Hyperactive Member jovton's Avatar
    Join Date
    Nov 2000
    Location
    South Africa
    Posts
    266
    No, the mixer functions always return zero, if successful.
    MMSYSERR_NOERROR = 0.
    So
    Code:
    if (rc != 0)
    {
        // An error occured
    }
    jovton

  5. #5
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    I know that, but your code assumes its an error if it returns 0
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  6. #6

    Thread Starter
    Hyperactive Member jovton's Avatar
    Join Date
    Nov 2000
    Location
    South Africa
    Posts
    266
    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 !=
    jovton

  7. #7
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    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
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  8. #8

    Thread Starter
    Hyperactive Member jovton's Avatar
    Join Date
    Nov 2000
    Location
    South Africa
    Posts
    266
    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
    jovton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width