Solved

converting wav to mp3

Posted on 2009-05-07
5
366 Views
Last Modified: 2013-12-17
I need to convrt wav files to mp3 whithin my c# desktop app.
What is the efficient way for doing this?
0
Comment
Question by:yaron89
  • 2
  • 2
5 Comments
 
LVL 21

Expert Comment

by:Tapan Pattanaik
ID: 24327286
0
 
LVL 39

Expert Comment

by:abel
ID: 24327294
I'm sure you are not attempting to write the algorithms yourself, are you? Here are some links:

using lame:
http://www.csharphelp.com/archives/archive264.html

using a shareware dll:
http://www.download3k.com/Software-Development/Active-X/Download-free-Mp3-Format-DLL.html

0
 
LVL 39

Expert Comment

by:abel
ID: 24327303
hi tapan, using google the same way I do? Seem to be on the same page here lol ;-)
0
 
LVL 23

Expert Comment

by:Kamaraj Subramanian
ID: 24327336
0
 
LVL 23

Accepted Solution

by:
Kamaraj Subramanian earned 500 total points
ID: 24327348
download lame.exe from here.. and put in the bin directory. and run your exe or code

http://www.free-codecs.com/download/Lame_Encoder.htm
public void mciConvertWavMP3(string fileName, bool waitFlag)

{

//maxLen is in ms (1000 = 1 second)

string outfile= "-b 32 --resample 22.05 -m m \""+pworkingDir+fileName + "\" \"" + pworkingDir+fileName.Replace(".wav",".mp3")+"\"";

System.Diagnostics.ProcessStartInfo psi=new System.Diagnostics.ProcessStartInfo();

psi.FileName="\""+pworkingDir+"lame.exe"+"\"";

psi.Arguments=outfile;

//psi.WorkingDirectory=pworkingDir;

psi.WindowStyle=System.Diagnostics.ProcessWindowStyle.Minimized;

System.Diagnostics.Process p=System.Diagnostics.Process.Start(psi);

if (waitFlag)

{

p.WaitForExit();

// wait for exit of called application

}

}

Open in new window

0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now