-
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
Strange exception: msvcrt.dll #31
Comments
What operating system are you running on? Does it happen immediately, or after the application has been running for some time? |
Win10 x64. |
The underlying COM object may get destroyed. Taking a quick look at the session code, there may be some enhancements in that space regarding object lifecycle. |
One more thing ... My application is basically a stopwatch, which plays a command on start and plays another random audio track on end. It seems that just one specific audio track triggers this error. The audio track is a 10s long .wav file of some song. |
Are you able to create a gist or attach a piece of self contained code that can be used to reproduce it? If you can, it should be fairly easy to track down and fix. |
Here you go: Run the project, press Start, wait for the counter to start counting and then press Stop. You should get the mentioned exception. |
It seems that the main problem is this block of code: If I remove the using block and normally create a new SoundPlayer instance, the application stops crashing. It seems the SoundPlayer instance created inside the using block is getting disposed before it finishes playing the sound. But if I remove your library, the SoundPlayer works fine even when using it with the using block. |
I had a look at this in the weekend, and it's definitely in the Session Initialization code. I should be able to track it down, and make a fix for it. I'll tag the commit in here, once it's done. Cheers. |
Hello,
I randomly encounter the following error in my program when using this library:
The following line of code is enough to trigger the exception:
var sessions = audioController.DefaultPlaybackDevice.GetCapability<IAudioSessionController>();
Any clue what might be wrong?
The text was updated successfully, but these errors were encountered: