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

System.AccessViolationException ASIO #1212

Open
recon472 opened this issue Feb 25, 2025 · 1 comment
Open

System.AccessViolationException ASIO #1212

recon472 opened this issue Feb 25, 2025 · 1 comment

Comments

@recon472
Copy link

I have an app to play music using naudio, I get this System.AccessViolationException from time to time using ASIO. any idea what might be causing this or how can I at least prevent it from crashing my app?

CoreCLR Version: 8.0.123.58001 .NET Version: 8.0.1 Description: The process was terminated due to an unhandled exception. Exception Info: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. Stack: at NAudio.Wave.Asio.AsioSampleConvertor.ConvertorFloatToIntGeneric(IntPtr, IntPtr[], Int32, Int32) at NAudio.Wave.Asio.AsioDriverExt.BufferSwitchCallBack(Int32, Boolean)

@rdyhalt
Copy link

rdyhalt commented Feb 25, 2025

I have not worked with Asio before.
But perhaps there is some memory that is still referenced to in your own code. Like an array of bytes.
Perhaps copy the buffer with the sound to your own buffer before returning?

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

2 participants