Skylar Kennedy
Skylar Kennedy

Reputation: 367

How would I go about programmatically capturing internal audio?

I'm trying to create a windows application, preferably in .NET, that performs waveform analysis and acoustic fingerprinting on incoming internal audio. By 'internal audio' I mean the sound that plays through my speakers, for instance, when I watch a youtube video or play an mp4 file. How would I go about capturing this internal audio?

Upvotes: 0

Views: 144

Answers (1)

tobythomassen
tobythomassen

Reputation: 147

You are looking for Naudio. Although it does not have "internal audio" you could just load the mp3 or audio URL link. Another library that is very similar is cscore.

Here is an NAudio example

WaveIn waveInStream;
WaveFileWriter writer;
waveInStream = new WaveIn(44100,2);
writer = new WaveFileWriter(outputFilename, waveInStream.WaveFormat);
waveInStream.DataAvailable += new EventHandler<WaveInEventArgs>(waveInStream_DataAvailable);
waveInStream.StartRecording();

void waveInStream_DataAvailable(object sender, WaveInEventArgs e)
{
   writer.WriteData(e.Buffer, 0, e.BytesRecorded);
}

Upvotes: 1

Related Questions