有没有办法在ASP.NET中将WAV文件转换为MP3?我听说过LAME,但还没有找到任何web应用程序的示例。此外,我也不确定它是否可以商业化。
谢谢
发布于 2009-12-28 07:59:40
尝试以下代码:
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();
}
}发布于 2009-12-28 18:39:53
CodeProject上有一个article,展示了如何使用Lame编解码器在C#中压缩wave文件。它是编解码器的托管包装器。
https://stackoverflow.com/questions/1967434
复制相似问题