Skip to content
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

DirectSoundOut throws NullReferenceException on Finalize() #395

Open
amysgames opened this issue Nov 1, 2019 · 2 comments
Open

DirectSoundOut throws NullReferenceException on Finalize() #395

amysgames opened this issue Nov 1, 2019 · 2 comments

Comments

@amysgames
Copy link

amysgames commented Nov 1, 2019

As stated in the title, DirectSoundOut seems to be throwing a NullReferenceException on Finalize if it's been initialized before closing the app. No exceptions if it hasn't been initialized yet. It seems to be a DirectSound issue specifically, because I switched to Wasapi and it didn't throw any exceptions. I'm using v1.2.1.2 from NuGet.

Here's the error I got:

System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=CSCore
StackTrace:
at CSCore.DirectSound.DirectSoundBuffer.StopNative()
at CSCore.DirectSound.DirectSoundBuffer.Stop()
at CSCore.SoundOut.DirectSoundOut.CleanupResources()
at CSCore.SoundOut.DirectSoundOut.Dispose(Boolean disposing)
at CSCore.SoundOut.DirectSoundOut.Finalize()

@jbarber3388
Copy link
Contributor

This is also an issue with the WaveIn and WaveInBuffer class as well.

#393

@filoe
Copy link
Owner

filoe commented Dec 2, 2019

For a quick fix, try to use WasapiOut. #393.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants