Problem I am facing is relatively same but I want the control for that through the use of programming. I want to adjust the volume of my speakers from my vb application.
I work with VB Express 2008 on a Vista environment, and here is the code that I am using.
Code:
Declare Function Lib waveOutSetVolume "WinMM" (ByVal wDeviceID As IntPtr, ByVal dwVolume As System.UInt32) As Integer
Sub RegleVolume (ByVal i As Integer) 'Volume 0 to 100%
Sun stVolDr As String 'Volume Right
Sun stVolGa As String 'Volume left
stVolGa = Hex ((i / 100) * 65535)
stVolDr = Right ("0000" & Hex ((i / 100) * 65535), 4)
waveOutSetVolume (0, CLng ("& h" & & stVolGa stVolDr))
End Sub
The problem is that from that snippet, I cannot handle the speakers, I manage only to change the volume of my application. If the speakers are at 0 or mute so I have no sound for the application. I already found some C source to me seems very complicated! Your help will be invaluable to me; I do not know how to do it.
Bookmarks