SystemSounds not working

I am trying to play the sound of an Asterisk system using a C # program using

System.Media.SystemSounds.Asterisk.Play(); 

but the sound does not play. My system has a sound configured for Asterisk and other programs (not written by me) that trigger various system sounds.

Can anyone suggest any possible reasons for this?

+3
source share
3 answers

I have ignored this problem until today. Some googling has shown that this is a fairly common problem and is not completely related to .NET Play calls.

What happens is that while you can play / listen to sounds using the Sounds and Audio Devices control panel, they do not play when programs start sounds. Apparently, this is corruption caused by software installations. The fix is ​​pretty simple.

The entry (by default) for HKEY_CURRENT_USER in the registry should be (value not specified). If this is something else (mine was OfficeCompleted), delete the entry (right-click and select delete) and it will be recreated as (no value set). Then system sounds should sound.

+4
source

Sorry if this overstates the obvious ...

  • Are you sure this line of code is executing?
  • According to RobS, any of the other SystemSounds games?

I looked into the reflector. Whatever the SystemSounds call, the returned SystemSound instance initialized with the type (e.g. 0x40 for Asterix) for the system sound you want to play. Then it is passed to the Win32 bool MessageBeep method (int type). Imported as:

 [DllImport("user32.dll", CharSet=CharSet.Auto, ExactSpelling=true)] internal static extern bool MessageBeep(int type); 

The return bool is in no way saved - i.e. you cannot get it: (

Exceptions are not swallowed, so you should get them if they are thrown.

Hope this helps (although probably just telling you what you already know)

+1
source

I'm only 8 years late for the party, but I had this problem on my Windows 7 tablet. What did it fix? Classic Restart .

Try rebooting your device.

+1
source

All Articles