将wav转换为mp3 - ASP.NET

Nic*_*ick 10 .net c# asp.net

有没有办法在ASP.NET中将WAV文件转换为MP3?我听说过LAME但没有找到任何Web应用程序的示例.另外,我不确定它是否可以在商业上使用.

谢谢

aff*_*tee 14

试试这段代码:

public void mciConvertWavMP3(string fileName, bool waitFlag) {
        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.WindowStyle=System.Diagnostics.ProcessWindowStyle.Minimized;
        System.Diagnostics.Process p=System.Diagnostics.Process.Start(psi);
        if (waitFlag)
        {
        p.WaitForExit();
        }
 }
Run Code Online (Sandbox Code Playgroud)

  • 工作良好.最快的解决方案.跛脚exe从这里取得http://www.rarewares.org/mp3-lame-bundle.php感谢你,你救了我几个小时!! :) (4认同)