profile-pic

Jordan Hook

Software Developer


Last Modified: 17/10/2019

Audio Capture Library is a simple C# interface in which allows your projects to capture audio as raw data sets from the default recording device on the client machine. This library utilizes windows APIs to provide a constant feed of audio information at a set interval in .wav format. The original purpose of this project was to create a simple audio capture interface for a small VO-IP project that I was working on for school. 

The library is very simple to use. Once you include the required references (see github), you will be able to create a new instance of the capturer object.

//Parameter is capture delay
AudioCapture capture = new AudioCapture(1000);

The parameter provided to the constructor is the delay in which audio will be recorded; in other words it specifies the length of the audio clips in which will be captured in milliseconds. To receive these clips you must setup an event handler for the BitCapturedHandle callback. Each time this event is invoked you will receive the .wav data in raw byte[] format.

//Parameter is capture delay
AudioCapture capture = new AudioCapture(1000);

//subscribe to event 
capture += BitCapturedHandle; 

//capture is the wave file 
public void BitCapturedHandle(byte[] capture)
{
   //you can no do what you please with the audio data 
}

You can then manipulate the capture data to your purpose whether it be saving to a file, encoding, or transferring over a network. 

If you are interested in the project or wish to view the full source code, please visit the github link below! 

AudioCapture Library (GitHub)