I’m trying to record the Speaker Output to detect volume and BPM from any playing music with C# and NAudio API.
The problem is, i don’t know how to do that :/
i have a sample code from http://opensebj.blogspot.de/2009/04/naudio-tutorial-5-recording-audio.html where they record simple input with less code…
waveInStream = new WaveIn(44100,2);
what does the “44100, 2” means ? does that targets the device to record from ???
how can i target speaker output ?
does anyone can help me out ? or even with another API ?
thx
What you’re probably looking for is the
WasapiLoopbackCaptureclass, which allows you to record all the sound your computer is producing. NOTE: This works in Windows Vista/7 only!To start recording, do this:
Then, every time the recording buffer is full, the
InputBufferToFileCallbackfunction will be called:I think you’ve been put on the wrong track by the tutorial you linked, because in the current release of NAudio I don’t see the
new WaveIn(44100,2);constructor. NAudio probably has been modified since the tutorial was first written.As a final note, the numbers 44100 and 2 denote the sample rate and the number of channels respectively.