Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void RunFFMPEG(string path)
- {
- FileInfo file = new FileInfo(path);
- string filename = Path.GetFileNameWithoutExtension(file.FullName);
- string resultName = $"Songs\\{filename}";
- string args = $"-i \"{file.FullName}\" -c libvorbis \"{resultName}.ogg\"";
- Process ffmpeg = new Process
- {
- StartInfo =
- {
- FileName = @"ffmpeg/ffmpeg.exe",
- Arguments = args,
- CreateNoWindow = true,
- UseShellExecute = false,
- RedirectStandardOutput = true
- }
- };
- ffmpeg.EnableRaisingEvents = true;
- ffmpeg.Exited += (o, e) => { AudioManager.Instance.Music.Filename = filename; };
- ffmpeg.Start();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement