naudio / NAudio

Audio and MIDI library for .NET
MIT License
5.47k stars 1.09k forks source link

UWP Asio App - System.AccessViolationException #822

Open josephnarai opened 3 years ago

josephnarai commented 3 years ago

I'm getting 'System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'

When I try and use Asio:

        _AsioDriverNames = AsioOut.GetDriverNames();
        if (_AsioDriverNames.Length <= 0)
        {
            Debug.WriteLine("No ASIO Drivers Found");
        }

        string driverName = _AsioDriverNames[0];

        _AsioOut = new AsioOut(driverName);   << access violati9on here.

I was thinking with UWP (WinUI2) apps you need to set the capabilities, could the be something I'm missing? I couldn't find any references to capabilities in the docs anywhere...

Any clues would be greatly appreciated.

J

markheath commented 2 years ago

Not sure if ASIO is allowed in UWP. Also you must use [STAThread] with ASIO - not sure if that's possible in UWP.