[DllImport("winmm.dll", SetLastError=true, CallingConvention=CallingConvention.Winapi)]
public static extern int waveOutSetVolume(int uDeviceID, int dwVolume);
[DllImport("winmm.dll", SetLastError=true, CallingConvention=CallingConvention.Winapi)]
public static extern int waveOutSetVolume(IntPtr uDeviceID, int dwVolume);
Declare Auto Function waveOutSetVolume Lib "winmm.dll" (ByVal uDeviceID As Integer, ByVal dwVolume As Integer) As Integer
None.
Do you know one? Please contribute it!
VB - Use "Auto" in the Declare statement to have VB automatically marshal strings using the proper coding. ANSI is default.
Please add some!
// Each volume setting must be in the range between &H0 (silence) and &HFFFF (maximum volume).
// ' Set the volume for all channels to &H7FFF (50%)
// retval = waveOutSetVolume(0, &H7FFF7FFF) ' for both channels, if needed
public void SetVolume(int volume)
{
if (m_WaveOut != IntPtr.Zero)
WaveNative.waveOutSetVolume(m_WaveOut,volume);
}