clean up a bit

This commit is contained in:
zeromus 2011-09-04 05:54:50 +00:00
parent 290cf76223
commit 7cd0cd87f5
1 changed files with 3 additions and 12 deletions

View File

@ -30,7 +30,9 @@ namespace BizHawk
try
{
File.WriteAllBytes(tempfile, waveData);
Encode(tempfile, string.Format("{0} - Track {1:D2}.mp3", Path.Combine(path, filebase), track.num));
string mp3Path = string.Format("{0} - Track {1:D2}.mp3", Path.Combine(path, filebase), track.num);
var ffmpeg = new FFMpeg();
ffmpeg.Run("-f", "s16le", "-ar", "44100", "-ac", "2", "-i", tempfile, "-f", "mp3", "-ab", "192k", mp3Path);
}
finally
{
@ -38,16 +40,5 @@ namespace BizHawk
}
}
}
static void Encode(string wavePath, string mp3Path)
{
var ffmpeg = new FFMpeg();
ffmpeg.Run("-f", "s16le", "-ar", "44100", "-ac", "2", "-i", wavePath, "-f", "mp3", "-ab", "192k", mp3Path);
}
static string[] Escape(params string[] args)
{
return args.Select(s => s.Contains(" ") ? string.Format("\"{0}\"", s) : s).ToArray();
}
}
}