在 SoxSharp 中使用 lame

Using lame from within SoxSharp

我一直使用此命令行创建比特率:32kBit/s 和采样率:22050 Hz 的 mp3:

"lame -b 32 --resample 22050 input.wav output.mp3"

现在我想为此使用 SoxSharp,它有一个 mp3 选项并使用 libmp3lame.dll,所以我想它应该可以工作。

但是,我无法计算出正确的参数。

下面列出了 mp3 输出的可用参数。

    Using nSox As Sox = New Sox("d:\dev\projects\sox-14-4-0\sox.exe")

        nSox.Output.Type = FileType.MP3
        nSox.Output.SampleRate = I guess that would be 22050 in my case?
        nSox.Output.Channels = 1 'yep, I want mono
        nSox.Output.Encoding = // not sure what to make of it
        nSox.Output.SampleSize = // not sure what to make of it
        nSox.Output.ByteOrder = // I guess I shouldn't touch that
        nSox.Output.ReverseBits  = // I guess I shouldn't touch that
        nSox.Output.Compression = // absolutely not sure what I should choose here

        nSox.Process("input.wav", "output.mp3")

    End Using

有人看到我应该在哪里插入“32”吗?在我的情况下 .SampleRate = 22050 是否正确? Windows 文件 属性 对话不会给我任何真正的提示,如果我做得正确,Audacity 会将音频转换为我的项目格式。

非常感谢您的帮助!

调查 SoxSharp 的源代码,它甚至不能开箱即用地处理最基本的蹩脚命令。基本上所有东西都必须放在 "CustomArguments" 属性 中。