views:

189

answers:

3

I want to read an mp3 file, crop section of it, fade in & out and finally save it as a new mp3 file. I found a library called DirectShow that apparently can do this, but I can figure out how to do it. Has anyone done something like this?

+1  A: 

You can look a library called WinnydowsMediaLib available on http://www.winnydows.com/#Downloads website. It's a .net wrapper for ffmpeg library. FFMpeg is able to open, cut and save mp3 files

Gregg
looks promising, will check it out. Thanks dude
Yo Momma
+1  A: 

I recommend using SoX (Sound eXchange):

SoX is a cross-platform (Windows, Linux, MacOS X, etc.) command line utility that can convert various formats of computer audio files in to other formats. It can also apply various effects to these sound files, and, as an added bonus, SoX can play and record audio files on most platforms.

I recommend that you have a look at the features page. It seems to offer exactly what you need to do.

Multiple audio files can be combined (and then further processed with effects) using any one of the following combiner methods:

  • concatenate
  • mix
  • merge: E.g. two mono files to one stereo file
  • sequence: For playing multiple audio files/streams

Now using this you can simply use the command line file in conjunction with ProcessStartInfo and Process.Start() and you should be on your way. A very quick example:

ProcessStartInfo psi = new ProcessStartInfo(PathOfCmdLine);
psi.RedirectStandardOutput = false;
psi.WindowStyle = ProcessWindowStyle.Hidden;
psi.UseShellExecute = true;
psi.Arguments = "ArgsHere";

Process.Start(psi);
Kyle Rozendo
This looks even more promising than the one above
Yo Momma
I also used ffmpeg. This works too. It's less of a hassle to to get working but SOX has much more functionality.
Yo Momma
A: 

You can probably do this with the open-source .NET lib NAudio: http://naudio.codeplex.com

Conrad Albrecht