Click here to Skip to main content
Click here to Skip to main content

Audio DSP with C#

By , 6 Sep 2003
 

Sample Image - audio_process.jpg

Introduction

Garbe.Sound is a small .NET library for audio processing. The principal idea is to give programmers with a RAD environment for developing audio filters. With the basic classes, it comes with a few filters already implemented, like:

  • Gain Filter
  • Delay Filter
  • LowPass Filter
  • Mixer
  • Reverberation
  • Head Related Transfer Function (HRTF)
  • Read and Write Wave Files (just mono yet)

The library is still a Beta 1 Version, but is already functional. Any comments are welcome!! :)

Using the code

One of the ideias of the library is to be easy of programming. Trying to do so, I choose a sistematic view of the classes in the library, where each filter can be perceived like a box with a input and output signal.

Almost all classes in the library inheritance from SoundObj class, that implements this basic sistematic view. This permits that you write code like this:

WaveReader    wr1 = new WaveReader("teste2.wav");
WaveReader    wr2 = new WaveReader("teste.wav");
Gain        ga1 = new Gain(0.5f);
Gain        ga2 = new Gain(0.5f);
Mixer        mx  = new Mixer(2);
WaveWriter    wwl = new WaveWriter("exit.wav", wr1.NumChannels, 
                                 wr1.SampleRate, wr1.BitsPerSamples, 1, true);
            
ga1.Input = wr1;
ga2.Input = wr2;
mx[0] = ga1;
mx[1] = ga2;
wwl.Input = mx;
            
for(int k = 0; k < wwl.Interations; k++)
{
    wr1.DoProcess();
    wr2.DoProcess();
    ga1.DoProcess();
    ga2.DoProcess();
    mx.DoProcess();
    wwl.DoProcess();
}

wr1.Close();
wr2.Close();
wwl.Close();

This is a very simple code that just have 2 signal inputs (teste.wav and teste2.wav), amplify both by 0.5 (ga1 and ga2 objects), mixes both in just one signal that is the output of the signal, wich is saved as exit.wav.

Links

History

  • 02.09.2003 - Beta 1

Bugs and Comments

If you have any comments or find some bugs, I would love to hear about it and make it better.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Não Interessa!!!
Brazil Brazil
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralMy vote of 5memberMember 963781229 Dec '12 - 9:41 
this is good page
QuestionNo accept cultural reference.memberagmva8 Nov '11 - 7:35 
When i try to compile this program i get this error:
"AssemblyFiles" have the value "C:\blablalba\garbe sound.dll" not valid.
Don't accept cultural reference
Name of parametter: name...
 
Any advice?
 
Thank you.
AnswerRe: No accept cultural reference.memberNils de Jong13 Apr '12 - 23:14 
In the Garbe.Sound project change
[assembly: AssemblyCulture("neutral")]
to
[assembly: AssemblyCulture("")]

GeneralRe: No accept cultural reference.membernfrench28 Jun '12 - 12:49 
I just spent half an hour trying to work this out, eventually sorted it, switched tabs and immediately saw this message -_-
Question44100hz, 8bit, mono wavs supported ?memberRich_UK25 Aug '09 - 21:44 
Ive been looking at creating lowpass and high pass filters and not much on the net to give me the maths but I tried this and for some reason even on a small wav it takes an along time then seems to lock up, ive not debugged it yet but seem tot be reading to _eof of the reader but still going and nothing output
 
any help would be great, my wav files are 44100hz, 8bit, mono if that makes a difference
GeneralMy vote of 2membergunzygcs12 Feb '09 - 7:28 
no intention to rate it poor but dont really understand how this thing work Frown | :( -- my bad --
QuestionNewbie eager to learn..membergunzygcs12 Feb '09 - 7:23 
Hi all, been reading alot of article for a while but cant really understand the code that is given Frown | :(
I would like to develop an equalizer (like in winamp) for my video player appl. Plz help me understand more about the basic procedure in making equalizer component.. a link, a hint, a comment, anything that can make me start.
Thx alot Smile | :)
GeneralTMS320F2812 DSP codememberpratik suthar20 Nov '08 - 3:08 
want ot interface graphic LCD with F2812 give me the tips
Generalreading from sound Reader and specifying Frequencymemberashenayeemruz28 Feb '08 - 16:35 
I want to give sound from sound card and specify its Frequency per scond. please help me...
QuestionPlaying continuous stream of PCM datamembert4urean7 Aug '06 - 10:28 
My project has a method that continuously reads a block of PCM data from an external radio receiver connected to the computer through USB.
 
Is there and way to listen to that signal through C#. IS PCM just like audio signal … if not how do I convert it into audio.
 
o O º(`'·.,(`'·., ☆,.·''),.·'')º O o°
»·'"`»* *☆ t4ure4n ☆* *«·'"`«
°o O º(,.·''(,.·'' ☆`'·.,)`'·.,)º O o°

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web03 | 2.6.130523.1 | Last Updated 7 Sep 2003
Article Copyright 2003 by Não Interessa!!!
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid