Sound / Beep function from within VB or Excel VBA

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
 
A

Alice

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top