Click to See Complete Forum and Search --> : Play Command (GW BASIC)


srinika
October 4th, 2001, 01:24 AM
Any body familiar with QBASIC or GW BASIC may know about the Play command ?
Ie. a function requesting for 2 parameters viz : Frequency & Duration
Once this line get executed the sound corresponding to the Frequency specified, will be played by the system speaker.

Eg: Play (700, 20) ' this line will play the sound having 700 Hz for a period of 20 seconds

Is there a Similar function or any thing in VB (I am not interested in MIDI file players etc)
Srinika

Andrew R.
October 4th, 2001, 08:45 PM
You can use Win32 function.

' declaration
private Declare Function Beep Lib "kernel32" (byval dwFreq as Long, _
byval dwDuration as Long) as Long
' button handler
private Sub Command1_Click()
Beep 700, 20000
End Sub



Duration is in milliseconds of course.