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

WASAPI Capture Catastrophic Failure #1187

Open
cryingsauerkraut opened this issue Oct 8, 2024 · 0 comments
Open

WASAPI Capture Catastrophic Failure #1187

cryingsauerkraut opened this issue Oct 8, 2024 · 0 comments

Comments

@cryingsauerkraut
Copy link

cryingsauerkraut commented Oct 8, 2024

Attempting to start a WASAPI capture with the default constructor returns an exception from hresult 0x8000FFFF, Catastrophic failure when called from a Windows service. Since the latest Windows 11 update, my app has been crashing on trying to start a WASAPI mic capture and is deployed as a self contained, single file Windows service.

Initializing the capture:

waveFormat = new WaveFormat(48000, 16, 1);
writerMic = new WaveFileWriter(Path.Combine(outputPath, "mic.wav"), waveFormat);
captureMic = new WasapiCapture();
captureMic.WaveFormat = waveFormat;
captureMic.DataAvailable += (s, a) =>
{
    writerMic?.Write(a.Buffer, 0, a.BytesRecorded);
};
try
{
    captureMic.StartRecording();
}

And the result is:
image

This only happens when the application is deployed as a service, it runs fine when running from Visual Studio. I've been spinning my wheels on this problem for months, does anyone have any ideas?

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

1 participant