Recorder: A .NET recording component

Jul 5, 08:47 PM—Micah Wylde

As I found out a few months ago when trying to write an application which recorded audio from the sound card, there isn’t an easy way in C#. Your choices are twofold: managed DirectAudio with its lack of documentation or unmanaged Win32 apis.

In an attempt to make things simpler, I created this library, which allows you to read data from any soundcard with only a few lines of code.

Version 0.5 is available here.

In addition, I have created a sample project (pictured above) which demonstrates how to use the library. It can be downloaded from here.

Using the library is as simple as this:


Recorder recorder = new Recorder();
recorder.Start();
recorder.Stop();
recorder.WriteWave("test.wav");

Data is captured in the PCM format, which is the simplest format for digitizing analog waves. PCM works by sampling a wave a different points, then quantizing the amplitude at those points.

Note: Recorder requires VS2005, as well as a relatively recent release of managed DirectX. The former can be downloaded for free as an Express Edition, while the latter can be downloaded from Microsoft here.

Note also that due to problems with managed DirectX, you must disable the loaderlock exception from within your directX project. This can be done by typing ctr-d, then e, then opening the Managed Debugging Assistants list, and unchecking LoaderLock.

  1. #1 On Jul 19, 12:05 PM huh said

    So you have no source code available at all, just a dll and sample project.



Search:


This site is a collection of musings and articles on varied topics such as web standards/css, programming, digital rights, and, well, accordions.

Categories

Recent Articles:

Feeds

Links