Skip to content

WASAPI Capture Catastrophic Failure #1187

Open
@cryingsauerkraut

Description

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions