Results 1 to 2 of 2

Thread: VB Sound Creation

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2000
    Posts
    1
    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.

  2. #2
    Lively Member
    Join Date
    May 1999
    Location
    KC
    Posts
    72
    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
  •  



Click Here to Expand Forum to Full Width