简体   繁体   中英

System.Media.SoundPlayer only plays through one speaker

I have a sound I am playing through System.Media.SoundPlayer in C#. When I play it within visual studio it plays fine through both speakers. However, when I play it using System.Media.SoundPlayer, it only plays through the left speaker. I am using the code:

System.Media.SoundPlayer snd = new System.Media.SoundPlayer(Resource1.Radio);
snd.PlayLooping();

Does anyone know how to fix this?

I had the same problem and could fix it this way:

  • stop windows audio service (command line: net stop AudioSrv )
  • delete this registry folder: HKLU\\Software\\Microsoft\\Internet Explorer\\LowRegistry\\Audio\\PolicyConfig\\PropertyStore
  • start windows audio service (command line: net start AudioSrv )

This clears any stored process-specific channel-wise volume settings, that may have been modified before (in my case this had happened through calling the waveOutSetVolume() API function).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM