Ejemplo n.º 1
0
        public string ConvertALACToFLAC(string filePath, TrackFingerprint fingerprint)
        {
            var output     = filePath.Replace(Source, Destination);
            var outputPath = Path.GetDirectoryName(output);
            var basename   = Path.GetFileNameWithoutExtension(output);

            Directory.CreateDirectory(outputPath);

            var converter = new FFmpegCommand();

            converter.Codec      = "alac";
            converter.InputPath  = filePath;
            converter.OutputPath = String.Format("{0}\\{1}.m4a", outputPath, basename);
            converter.Hash       = fingerprint.ToString();

            converter.Convert();

            return(converter.OutputPath);
        }
Ejemplo n.º 2
0
        public string CopySupportedFile(string filePath, TrackFingerprint fingerprint)
        {
            FFmpegCommand converter = new FFmpegCommand();

            converter.Codec      = "copy";
            converter.InputPath  = filePath;
            converter.OutputPath = filePath.Replace(Source, Destination);

            var outputPath = Path.GetDirectoryName(converter.OutputPath);

            Directory.CreateDirectory(outputPath);

            converter.Convert();

            var file = TagLib.File.Create(converter.OutputPath);

            file.Tag.Comment = fingerprint.ToString();
            file.Save();
            file.Dispose();


            return(converter.OutputPath);
        }