ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sound / Beep function from within VB or Excel VBA (https://www.excelbanter.com/excel-programming/399400-sound-beep-function-within-vbulletin-excel-vba.html)

TomCee

Sound / Beep function from within VB or Excel VBA
 
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


JW[_2_]

Sound / Beep function from within VB or Excel VBA
 
Have a look here.
http://www.exceltip.com/st/Playing_s...Excel/461.html

tomcee wrote:
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



TomCee

Sound / Beep function from within VB or Excel VBA
 
On Oct 16, 10:19 am, JW wrote:
Have a look here.http://www.exceltip.com/st/Playing_s...A_in_Microsoft...



tomcee wrote:
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- Hide quoted text -


- Show quoted text -


Thanks for the tip, but that tip shows how to play .wav files.

I would like to specify the frequency and duration (like the 'sound'
command in QB), and have the system generate that tone through the
speakers.
Thanks,
TomCee


Alice[_8_]

Sound / Beep function from within VB or Excel VBA
 
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

"tomcee" ha scritto nel messaggio
ups.com...
On Oct 16, 10:19 am, JW wrote:
Have a look

here.http://www.exceltip.com/st/Playing_s...A_in_Microsoft..
..



tomcee wrote:
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- Hide quoted text -


- Show quoted text -


Thanks for the tip, but that tip shows how to play .wav files.

I would like to specify the frequency and duration (like the 'sound'
command in QB), and have the system generate that tone through the
speakers.
Thanks,
TomCee





All times are GMT +1. The time now is 10:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com