2 .net c# mp3 lame pixelsense
我在Microsoft Surface应用程序中以波形格式捕获音频文件.现在出于文件大小的原因,我想将wave文件转换为mp3文件.我在互联网上读到这样做的好处是使用跛脚.
但是如何从我的应用程序中调用此exe文件?以及如何将其包含在我的应用程序中?
小智 5
使用Process类调用外部应用程序:
string lameEXE = @"C:\path_of_lame\lame.exe";
string lameArgs = "-V2";
string wavFile = @"C:\my_wavs\input.wav";
string mp3File = @"C:\my_mp3s\output.mp3";
Process process = new Process();
process.StartInfo = new ProcessStartInfo();
process.StartInfo.FileName = lameEXE;
process.StartInfo.Arguments = string.Format(
"{0} {1} {2}",
lameArgs,
wavFile,
mp3File);
process.Start();
process.WaitForExit();
int exitCode = process.ExitCode;
Run Code Online (Sandbox Code Playgroud)