'How can I add a continuous beep sound which frequency I change really quickly

I made a visualization of the quick sort algorithm in c# wpf, and I wanted to add sound to it. Can I change the frequency of something like the Console.Beep while its playing?



Solution 1:[1]

Why don't you consult the .NET API browser of the .NET class you want to use? This should be your first place to go. Bookmark this page. Entering the class name into a web search engine will usually yield you a direct link to class' API documentation.

See the API documentation to learn more about Console.Beep Method and its limitations.

Console.Beep supports a frequency range of 37 Hz to 32.767 kHz (the real limitation should be the speaker's range).

int frequencyInHertz = 60;
int durationInMilliseconds = (int) TimeSpan.FromSeconds(10).TotalMilliseconds;
Console.Beep(frequencyInHertz, durationInMilliseconds);

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 BionicCode