In .NET, it is relatively easy and simple to work with images. It is possible to use the System.Drawing.Bitmap
class to open images in Bitmap, Jpeg and PNG formats and play with their pixels. The code below, for example, gets any image and returns its grayscale representation:
public void RemoverCores(Bitmap input)
{
Bitmap output = new Bitmap(input.Width, input.Height);
for (int i = 0; i <= input.Width; i++)
{
for (int j = 0; j <= input.Height; j++)
{
Color cores = input.GetPixel(i, j);
int media = (cores.R + cores.G + cores.B) / 3;
output.SetPixel(j, j, Color.FromArgb(media, media, media));
}
}
return output;
}
I learned in college that images and sounds are just two distinct forms of signs of a similar nature, and that algorithms that apply to one form also apply to another >.
For example, the same algorithm that "clears" an image serves to remove noise from an audio track. We simply use time rather than height and width when we treat a sound rather than an image and, if I remember correctly, instead of color bands we have ranges of sound frequencies.
In college we did this with Matlab. However I'd like to work with sounds in .NET, with C #. Is there any embedded or official API for this? If it does not exist, at least is there any project with which I can at least generate and manipulate a .wav or .mp3 file?