Sunday, March 16, 2014

Graphic Equalizer in C++

I wanted my Echolink audio to sound better (or adjustable for a given MIC/headset). I was in need of a graphic equalizer to adjust my audio input spectrum. I came out with the following plan:
  1. Mic input Capture Routine in C++
  2. Perform 10 band Graphic Equalizer on the Captured data in C++
  3. Render the processes audio samples to Virtual Audio Cable Input in C++
  4. Configure Echolink recording input as Virtual Audio Cable Output

Capture Routine

The Capture routine is based on Windows Core Audio APIs. The MSDN example  Capturing a Stream  was modified to capture in Exclusive Mode. Exclusive mode was chosen to ensure that we could configure our best settings for the capture device. The MyAudioSink was made a dummy and the processing of audio data was done in a separate thread with thread priority boost.

Render Routine

The Render routine is based on Windows Core Audio APIs. The MSDN example Exclusive-Mode Streams was used as reference and modifed to our needs. Again for rendering also Exclusive mode was chosen. The MyAudioSource was made a dummy class and the audio processing as mentioned earlier done in the separate thread.

Audio Processing: Graphic Equalizer

The 10 band graphic equalizer was implemented with a latency of 100 milliseconds. The equalizer worked for even 10 millisecond latency, but was set to 100 millisec to allow any additional processing.

The 10 band GE was based on bi-quad filter - an elegant implementation by Nigel Redmon.

Virtual Audio Cable

The processed audio was rendered to VB-Audio Virtual Cable. I am planning to do a virtual audio cable, which will be good learning project for virtual audio drivers in windows.

No comments:

Post a Comment