|
|
Title | Play a tone with a specific frequency in Visual Basic .NET |
Description | This example shows how to play a tone with a specific frequency in Visual Basic .NET. |
Keywords | sound, tone, frequency, noise, VB.NET |
Categories | Miscellany, Multimedia |
|
|
When the user clicks the Play button, the following code parses the tone's frequency (Hz) and duration (ms) from text boxes. It then calls System.Console.Beep to play the tone for the indicates duration.
|
|
Dim freq As Integer = Integer.Parse(txtFrequency.Text)
Dim duration As Integer = Integer.Parse(txtDuration.Text)
System.Console.Beep(freq, duration)
|
|
|
|
|
|