gmetax
gmetax

Reputation: 3973

NAudio Play Silence without speakers

I know that I can play silence audio like that

var silence = new SilenceProvider(sourceStream?.WaveFormat).ToSampleProvider();
wo = new WaveOutEvent();              
wo.Init(silence);
wo.Play();

but How can I play silence when no speakers are attached to the computer?

I want to capture realtime WASAPI audio but the callback don't get called up when nothing is playing, so I need to play silence

Upvotes: 1

Views: 676

Answers (1)

Mark Heath
Mark Heath

Reputation: 49522

You can only play silence if your computer actually has an audio output device. If it doesn't then you'd need to find another workaround for the WASAPI audio (such as timestamping the captured audio to account for periods of silence).

Upvotes: 0

Related Questions