How can I adjust audio volume (for wav, MIDI, mp3 files) from within Excel ?
For wav:
Declare Function waveOutSetVolume Lib "Winmm" (ByVal wDeviceID As Integer,
ByVal dwVolume As Long) As Integer
Declare Function waveOutGetVolume Lib "Winmm" (ByVal wDeviceID As Integer,
dwVolume As Long) As Integer
Public Function GetVolume()
Dim a, i As Long
Dim tmp As String
a = waveOutGetVolume(0, i)
tmp = "&h" & Right(Hex$(i), 4)
GetVolume = CLng(tmp)
End Function
Public Function SetVolume(vol As Long)
Dim a, i As Long
Dim tmp As String
tmp = Right((Hex$(vol + 65536)), 4)
vol = CLng("&H" & tmp & tmp)
a = waveOutSetVolume(0, vol)
End Function
For other devices, look at the examples in ApiGuide.