如何使用lame.exe将wav文件转换为vb.net或c#在特定目录中的mp [英] How does one use lame.exe to convert wav files to mp in a specific directory with vb.net or c#

查看:87
本文介绍了如何使用lame.exe将wav文件转换为vb.net或c#在特定目录中的mp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要帮助使用跛脚。我有一堆wav格式的文件,并希望所有文件都从wav转换为mp3。我根本不知道如何使用lame.exe。



有人可以给我代码片段或者尽可能帮助。

I need help using lame. I have a bunch of files that I have in wav format and would like all to be converted from wav to mp3. I have no idea on how to use lame.exe at all.

Can someone please give me code snippets or help in anyway possible.

推荐答案

你需要'shell out'到LAME来进行编码。这意味着LAME将在其自己的进程中用完。



我不熟悉编码器的命令行参数,但是你需要String 。格式化它们,然后将它们传递给Process.Start()。



再次参考文档,但是你可以隐藏这个过程,以免它出现在如果你想同步调用它自己的窗口并等待它退出。
You need to 'shell out' to LAME to do the encoding. This means that LAME will run out of process in its own process.

I'm not familiar with the command line arguments of the encoder, but you will need to String.Format them, and then pass them to Process.Start().

Again, consult the documentation but you can hide the process so it doesn't show up in its own window and wait for it to exit if you want to call synchronously.


lame.exe是一个可接受参数的可执行文件,你必须:

- 打开命令行

- cd到lame.exe所在的目录

- 键入 lame /?获取与程序一起使用的可能开关列表



一旦有了这些开关,那么你必须写下你需要用你的.wav文件编码的开关。您想要的参数。



然后,当您想要从C#启动它时,您必须使用Process类,如Robolu中的Rob Philpott所示第1页。
lame.exe being an executable accepting arguments, you have to:
- open a command line
- cd to the directory where lame.exe resides
- type lame /? to get a list of possible switches to use with the program

Once you have these switches, then you have to write down the one that you will need to encode your .wav files with the parameters you want.

Then, when you want to launch it from C#, you have to use the Process class, as indicated by Rob Philpott in Solution 1.


这篇关于如何使用lame.exe将wav文件转换为vb.net或c#在特定目录中的mp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆