Sound / Beep function from within VB or Excel VBA

  • Thread starter Thread starter tomcee
  • Start date Start date
T

tomcee

I would like to output a sound with specific frequency and amplitude
through the pc soundcard (like the 'sound' function in QB).
(It appears that both VB and ExcelVBA have only a very simple 'Beep'
command.)
Control of channel (left and right) would be nice too.
Thanks,
TomCee
 
Private Type tbeep
F As Long
D As Long
End Type

Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal
dwDuration As Long) As Long

dim B as tbeep

b.F = 200 ' Frequency interval from 37 to 10000
b.D = 100 ' Duration

Beep b.F, b.D

Fede
 
Back
Top