|
-
Jun 8th, 2000, 02:45 AM
#1
Thread Starter
New Member
How do I create sounds in VB? For instance, I would like to create a sound that is a G note and lasts for 3 seconds. I don't want to record a G note, but create it from scratch. In other languages I have encountered functions that take pitch, length, etc. as parameters, but I can't find anything like this in VB.
-
Jun 8th, 2000, 03:19 AM
#2
Lively Member
There seems to be an API function to do that, but it only works in NT/2000. I have 98, so I can't test it.
Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As Long, ByVal dwDuration As Long) As Long
Private Sub Command1_Click()
'KPD-Team 1999
'URL: http://www.allapi.net/
'E-Mail: [email protected]
' Attempt to play a note at 800 Hz for 2 seconds. This will only
' behave this way on Windows NT/2000; users of Windows 95/98 will only hear the
' default sound.
Dim retval As Long ' return value
retval = Beep(800, 2000) ' ideally, an 800 Hz tone for 2 seconds
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|