xenolightning / AudioSwitcher_v1

Version 1 of Audio Switcher
Microsoft Public License
903 stars 89 forks source link

"System.NullReferenceException" in AudioSwitcher.AudioApi.CoreAudio.dll #2162

Closed EverBS2014 closed 6 years ago

EverBS2014 commented 6 years ago

I'm using VS2017 on Windows 10. My WPF application is using the lastest version of this API and has a Realtek onboard sound card

I want to set the volume of the windows setting to max like that:

 CoreAudioDevice defaultCaptureDevice = new CoreAudioController().DefaultCaptureDevice;
 defaultCaptureDevice.Volume = 100;

So far it's working but after the first call my CPU usage is increasing and I constantely receive this message in the VS2017 output window:

"System.NullReferenceException" in AudioSwitcher.AudioApi.CoreAudio.dll "System.NullReferenceException" in AudioSwitcher.AudioApi.CoreAudio.dll "System.NullReferenceException" in AudioSwitcher.AudioApi.CoreAudio.dll "System.NullReferenceException" in AudioSwitcher.AudioApi.CoreAudio.dll "System.NullReferenceException" in AudioSwitcher.AudioApi.CoreAudio.dll "System.NullReferenceException" in AudioSwitcher.AudioApi.CoreAudio.dll ....

It's not stopping. What is wrong?

xenolightning commented 6 years ago

Can you open it in the Api project? https://github.com/xenolightning/AudioSwitcher

With specific details on the version, and OS version?

Thanks.

EverBS2014 commented 6 years ago

I have downloaded your link, but which project do I have to start? I tried to build all with VS2017 but I get several errors about a api.pfx file

I'm using AudioSwitcher.AudioApi.CoreAudio. 3.0.0.1 And I have to problem with Win 7 and Win 10

My WPF application has as target framework .NET 4.5.2

xenolightning commented 6 years ago

Sorry. I meant open the issue in the Api Project. This project is for the desktop application.

Can you try using the latest version 4.0 alpha build instead of v3.0.0.1?