System beep in Windows 7

Is it possible to make an audio signal that always plays in the speakers so that people can hear it regardless of whether the headset is connected?

I am using C # wpf.Net 4.0 and of course windows 7

+4
source share
2 answers

Is it possible to make an audio signal that always plays in the speakers so that people can hear it regardless of whether the headset is connected?

Starting with Windows 7 and in 64-bit versions of previous operating systems, the answer is no, you cannot always make a hardware signal. Larry Osterman explains why .

You may have a beep, but the main functionality has moved to the Windows audio subsystem; so it will play through the headphones if they are connected. As far as I know, there is no way to force an audio signal in all cases in modern operating systems.

You can still beep using Console.Beep() .

+6
source

Declare it somewhere:

 [System.Runtime.InteropServices.DllImport("kernel32 .dll")] private static extern bool Beep(int freq, int dur); 

Then name it like this:

 Beep(440, 1000); // Concert A, for 1 second 
+2
source

Source: https://habr.com/ru/post/1380401/


All Articles