В итоге я использовал SOX и LAME exes, чтобы конвертировать в полезный wav-файл, а затем конвертировать в mp3. Это оказалось простым и эффективным решением. Вот основная часть кода:
// create temp file
tempFile = this.FolderFromFile(inputFileAndPath) + "tempFile.wav";
// Part 1: Convert mu-Law WAV to floating point WAV
// perform work with no display of console window
// Example: SOX.EXE MachMsg1.wav -e floating-point MsgFloatingPoint.wav
using (this)
{
System.Diagnostics.Process proc = new System.Diagnostics.Process
{
StartInfo = new System.Diagnostics.ProcessStartInfo
{
FileName = soxFileAndPath,
Arguments = inputFileAndPath + " " + "-e floating-point" + " " + tempFile,
UseShellExecute = false,
RedirectStandardOutput = true,
CreateNoWindow = true
}
};
proc.Start();
}
// Part 2: Convert floating point WAV to MP3 using highest quality possible
// perform work with no display of console window
// Example: LAME.EXE -V4 MsgFloatingPoint.wav MsgFloatingPoint.mp3
using (this)
{
System.Diagnostics.Process proc = new System.Diagnostics.Process
{
StartInfo = new System.Diagnostics.ProcessStartInfo
{
FileName = lameFileAndPath,
Arguments = "-V4" + " " + tempFile + " " + outputFileAndPath,
UseShellExecute = false,
RedirectStandardOutput = true,
CreateNoWindow = true
}
};
proc.Start();
}
SOX утилита командной строки: URL: http://sox.sourceforge.net/
Версия: SoX 14.4.2 выпущен на 02/22/2015
LAME компилируются утилиты командной строки : URL: http://www.rarewares.org/mp3-lame-bundle.php
Версия: LAME 3.99.5 выпущена 22.05.2014, Bundle, скомпилированная с помощью Intel Compiler 14.0.3.
Hydrogenaudio recommended settings
-- Best quality, "archiving"2 : -b 320
CBR 320 is the strongest setting for MP3, with the lowest risk of artifacts. With the exception of a few situations,
quality is rarely better than the highest VBR profiles described below.
-- High quality, HiFi, home or quiet listening : -V0 (avg. 245 kbps) or -V1 (avg. 225 kbps) or -V2 (avg. 190 kbps) or -V3 (avg. 175 kbps).
These settings are considered to produce transparent encoding (transparent = most people can't distinguish the MP3
from the original in an ABX blind test). Audible differences between these presets exist, but are rare.
-- Portable, background noise and low bitrate requirement, small sizes : -V4 (avg. 160 kbps) or -V5 (avg. 130 kbps)
or -V6 (avg. 115 kbps) -V6 produces an "acceptable" quality, while -V4 should be close to perceptual transparency.
-- Very low bitrate, small sizes, eg. for voice, radio, mono encoding : --abr 80 (stereo) or --abr 56 -m m (mono)
For very low bitrates, up to 100kbps, ABR is most often the best solution.