Results 1 to 6 of 6

Thread: System Volume

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2001
    Location
    Israel
    Posts
    10

    Question System Volume

    does anybody know how to change the main sound volume of the system...
    i cant find the api call.
    Love U All!

  2. #2
    Lively Member
    Join Date
    Jun 2001
    Posts
    69
    Declare Function auxSetVolume Lib "winmm.dll" (ByVal uDeviceID As Long, ByVal dwVolume As Long) As Long

    This example will set the volume of auxiliary audio device 0 to 50%.

    Dim retval As Long

    ' Set the volume of both channels (if a second exists) to 50%
    retval = auxSetVolume(0, &H80008000) ' both words are set

  3. #3
    Hyperactive Member Wak's Avatar
    Join Date
    Nov 2000
    Location
    Brisbane, Queensland
    Posts
    298

    I had a problem with this

    I realized that it hold the value of a long to 64000.... and then it wraps around, but how come sometimes it centers it to the left speakers and other times to the right speaker?? This is if I just use a long variable in the function?? Any ideas?
    Visual Basic 6.0 Enterprise
    Visual C++ 6.0 Professional

    Wak

  4. #4
    Dreamlax
    Guest
    Try This:

    Code:
    Dim lngSetVolTo As Long
    Dim strTemp As String
    lngSetVolTo = X / 100 * 65536
    strTemp = Hex(lngSetVolTo + 65536)
    If strTemp <> "20000" Then
     strTemp = Right(strTemp, 4)
     lngSetVolTo = CLng("&H" & strTemp & strTemp)
     auxSetVolume Y, lngSetVolTo
    Else
     auxSetVolume Y, -1
    End If
    X is the percentage of volume, and Y is the device number.

  5. #5
    Addicted Member
    Join Date
    Mar 2002
    Posts
    158
    dreamlax i cant get your snippet to work

    how does it work or can u make a zip pls

    thanks trav

  6. #6
    Megatron
    Guest
    See this link.

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