Click here to Skip to main content
15,891,184 members
Articles / Programming Languages / C#

Audio DSP with C#

Rate me:
Please Sign up or sign in to vote.
4.55/5 (23 votes)
6 Sep 20032 min read 219.8K   8.7K   92  
A .NET class library for audio processing.
using System;

namespace Garbe.Sound
{
	/// <summary> Basic Implemantation of ISoundObj and ISoundControl interfaces </summary>
	public abstract class SoundObj : ISoundObj, ISoundControl
	{
		/// <summary> Store the data the will be used as output signal </summary>
		protected float     _output;
		/// <summary> Store the object the is used as input signal </summary>
		protected SoundObj  _input;

		/// <summary> Basic Implemantation of ISoundObj and ISoundControl interfaces </summary>
		public SoundObj()
		{
			_output = 0;
		}

		/// <summary> Get the output Signal </summary>
		public virtual float Output
		{
			get{return(_output);}
		}

		/// <summary> Get or Set the input object </summary>
		public virtual SoundObj Input
		{
			get{return(_input);}
			set{_input = value;}
		}

		/// <summary> Do the signal processing </summary>
		public virtual void DoProcess()
		{
			_output = _input.Output;
		}

		/// <summary> Turns on or off the control of the signal </summary>
		public virtual bool Enable
		{
			get{return(true);}
		}

		/// <summary> Number of interations expected to do the signal processing </summary>
		public virtual int Interations
		{
			get{return(_input.Interations);}
		}

		/// <summary> Gets the sample rate of the signal </summary>
		public virtual uint SampleRate
		{
			get{return(_input.SampleRate);}
		}

		/// <summary> Gets the number of channels of the signal </summary>
		public virtual ushort NumChannels
		{
			get{return(1);}
		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

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


Written By
Brazil Brazil
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions