-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creates lots of Tasks that don't go away #74
Comments
Hmmm, that's a little weird. Can you post a sample of the code so I can take a look? |
.NET Framework 4.8.1 To test, I had a slightly modified version of this running at the same time as this version was running. That one changed the volume and muted the audio every 3 seconds. Both in separate instances of Visual Studio 2022 and both run in DEBUG mode. #define CHECKDEVICE namespace SetSpeaker
#endif |
You are creating a This should only be created once per application (ideally, but a few times here and there is also fine) It should also be disposed after use I'd move the creation of the controller outside of your main loop, it should solve the task issue |
Thanks.I didn't see that in any of the examples I found.Sent from my Galaxy
-------- Original message --------From: Sean Chapman ***@***.***> Date: 6/4/24 5:41 PM (GMT-05:00) To: xenolightning/AudioSwitcher ***@***.***> Cc: Mike Meinz ***@***.***>, Author ***@***.***> Subject: Re: [xenolightning/AudioSwitcher] Creates lots of Tasks that don't go
away (Issue #74)
You are creating a CoreAudioController controller many, many times.
This should only be created once per application (ideally, but a few times here and there is also fine)
It should also be disposed after use
I'd move the creation of the controller outside of your main loop, it should solve the task issue
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
I suspect that this NuGet package would be OK to use if you need to make a few calls. If you have a long running program, know that this NuGet package creates tasks(threads) and doesn't seem to terminate them.
In my case, I have a program that runs continuously to monitor an audio interface device to be sure it is the default playback device, that the volume is 100.0 and that it is not muted. After less than 24 hours, the PC locked up. I tried in Debug mode and found when I paused my app that Visual Studio reported lots and lots of tasks(threads) awaiting. Yes, I am using the latest 4.0 pre-release version created in 2017.
I have removed AudioSwitcher from my program and I am reverting to periodic human checking of the audio interface for the time being.
The text was updated successfully, but these errors were encountered: