예제 #1
0
        public async Task ConvertFromAacToMp3Async()
        {
            var ffmpeg = new FFmpeg();

            ffmpeg.Progress += e => { Debug.WriteLine(e); };

            var files = Directory.EnumerateFiles(@"", "*.aac").Select(x => new FileInfo(x));

            foreach (var file in files)
            {
                var instruction = new InstructionRoot()
                                  .AddInput(new Input(file.FullName))
                                  .AddOutput(new Output(file.FullName.Replace(".aac", ".mp3")))
                                  .GetInstruction();

                await ffmpeg.ExecuteAsync(instruction);
            }
        }
 public static InputRoot AddInput(this InstructionRoot root, Input input)
 {
     return(new InputRoot(root, input));
 }
 public static InputRoot AddInputs(this InstructionRoot root, IEnumerable <Input> inputs)
 {
     return(new InputRoot(root, inputs));
 }