コード例 #1
0
 public TranscodeAudio ConvertToAudio(String inputPath, String outputFolder, AudioFomatsSupported audioFormat)
 {
     validArguments(inputPath, outputFolder);
     _transcodeAudio = new TranscodeAudio();
     _transcodeAudio.Convert(inputPath, outputFolder, audioFormat);
     return _transcodeAudio;
 }
コード例 #2
0
        internal void Convert(String inputPath, String outputPath, AudioFomatsSupported audioFormat, ConversionOptions conversionOptions = null)
        {
            List<string> formats = new List<string>();
            formats.AddRange(Enum.GetNames(typeof(AudioFomatsSupported)).ToList());
            formats.AddRange(Enum.GetNames(typeof(VideoFomatsSupported)).ToList());

            if (!formats.Any(vfs => vfs.Equals(System.IO.Path.GetExtension(inputPath).ToLower().Substring(1))))
                            throw new Exception("Format du fichier n'est pas supporté");

            _inputFilePath = inputPath;
            _outputFilePath = outputPath;
            _audioFormatsSupported = audioFormat;
            conversionOptions = conversionOptions ?? new ConversionOptions();
        }