VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



There are a lot of code to produce a Beep (trough PC Speaker) with specified frequency and duration

by Pierre Ciparisse (1 Submission)
Category: Sound/MP3
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sun 16th September 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

There are a lot of code to produce a Beep (trough PC Speaker) with specified frequency and duration Some are short but only works under NT,

API Declarations


Private Declare Function vbInp Lib "win95io.dll" (ByVal nPort As Integer) As Integer
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Rate There are a lot of code to produce a Beep (trough PC Speaker) with specified frequency and duration



If Freq > 0 Then
        vbOut 67, 182
        vbOut 66, CInt(1193280 / Freq) And 255
        vbOut 66, CInt(1193280 / Freq) \ 256
        vbOut 97, vbInp(97) Or 3
        Sleep Duration
        vbOut 97, 0
    Else
        Sleep Duration
    End If
End Sub

Download this snippet    Add to My Saved Code

There are a lot of code to produce a Beep (trough PC Speaker) with specified frequency and duration Comments

No comments have been posted about There are a lot of code to produce a Beep (trough PC Speaker) with specified frequency and duration. Why not be the first to post a comment about There are a lot of code to produce a Beep (trough PC Speaker) with specified frequency and duration.

Post your comment

Subject:
Message:
0/1000 characters