I am trying to convert a .flac-file to a .wav-file using NReco.VideoConverter, but I keep getting an error and I do not know why. This is the piece of code I am using for the conversion:
//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 would be like this, this is what I see when I insert a breakpoint and check the values of in/outputFile:
string, inputFile/outputFile: "Z:\\Downloads\\Audio - File (Original Mix).flac" (or .wav)
And this is the error I receive when I run 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