我正在尝试使用 NReco.VideoConverter 将 .flac 文件转换为 .wav 文件,但我不断收到错误消息,我不知道为什么。这是我用于转换的一段代码:
//Create the NReco.VideoConverter.FFMpegConverter object
var ffmpeg = new FFMpegConverter();
//inputFile will be something like this:
//type: string, "C:\\some\\folder\\fullTrackName" + ".flac"
var inputFile = Path.Combine(downloadFolder + fullTrackNameNoExtension + ".flac");
//outputFile will be something like this:
//type: string, "C:\\some\\folder\\musicfile" + ".wav"
var outputFile = Path.Combine(downloadFolder + fullTrackNameNoExtension + ".wav");
//Convert the file using NReco.VideoConverter.FFMpegConverter
ffmpeg.ConvertMedia(inputFile, outputFile, null);
inputFile/outputFile 是这样的,这是我在插入断点并检查 in/outputFile 的值时看到的:
string, inputFile/outputFile: "Z:\\Downloads\\Audio - File (Original Mix).flac" (or .wav)
这是我在运行 ffmpeg.ConvertMedia 时收到的错误:
System.ArgumentException: The path is not of a legal form.
at System.IO.Path.LegacyNormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
at System.IO.Path.GetFullPathInternal(String path)
at System.IO.File.InternalGetLastWriteTimeUtc(String path, Boolean checkHost)
at NReco.VideoConverter.FFMpegConverter.EnsureFFMpegLibs()
at NReco.VideoConverter.FFMpegConverter.ConvertMedia(Media input, Media output, ConvertSettings settings)
at NReco.VideoConverter.FFMpegConverter.ConvertMedia(String inputFile, String inputFormat, String outputFile, String outputFormat, ConvertSettings settings)
at NReco.VideoConverter.FFMpegConverter.ConvertMedia(String inputFile, String outputFile, String outputFormat)
at APPLICATION_Name.APPLICATION_Class.ConvertFile(String downloadFolder, String fullTrackName, String fullTrackNameNoExtension, String downloadQuality, String downloadType) in X:\APPLICATION_Name\DownloadTrack.cs:line 244