Reputation: 7759
I know the obvious answer is "try google..." but i have and I either end up with graphics or cmd-line tutorials, so...
Can anyone point I in the direction of a c# tutorial for "listening" to the audio line-in? Or is it straight forward with the right namespace included? Is it even possible without using directx or some such.
I want to detect external audio activity and report it on screen.
Cheers,
Upvotes: 2
Views: 4686
Reputation: 49512
check out the VoiceRecorder sample application on Codeplex which shows how to do this using NAudio. This Coding4Fun article explains it in more detail.
Upvotes: 2
Reputation: 23961
You need an external library to do that. These have .NET bindings:
OR MDX can do this I think.
Upvotes: 2
Reputation: 25704
This code sample looks like it has everything that you need: VolumeMeter
Presumably you just need to change the code so that instead of rendering the current volume levels you could return a flag indicating whether "something" is going on.
It's using the Managed DirectX library, which is a managed code wrapper for the native DirectX APIs.
Upvotes: 3