Tony Valenti
Tony Valenti

Reputation: 39

NAudio - Detect Audio via Application

Windows Volume Mixer shows audio output for individual applications.

Using NAudio, what is the right way for me to tap into this information? I essentially want to be able to make my application say:

  1. Always record all audio input/output. Unless otherwise specified, only keep a buffer of the last 30 seconds. Throw the test away. (I know how to do this)
  2. When Skype, Vonage, or Ring Central plays audio for more than 5 seconds, ask the user if they want to start saving the audio. (How would I do this?)
  3. If so, save the 30-second buffer to a file and then start recording live. (I know how to do this)

Thanks for the help!

Upvotes: 1

Views: 596

Answers (1)

Mark Heath
Mark Heath

Reputation: 49522

Windows won't let you capture audio from individual applications. You can use NAudio's WasapiLoopbackCapture to capture audio from all applications.

If you just want to see audio output levels for all apps, that can be achieved with the IMMDevice APIs which NAudio has wrappers for. It doesn't come with a specific demo showing that, but there's another open source project, EarTrumpet that you could explore to see how its done.

Upvotes: 2

Related Questions