Skip to content

Commit

Permalink
Fix wrong ffmpeg download location.
Browse files Browse the repository at this point in the history
  • Loading branch information
azhuge233 committed Jun 22, 2023
1 parent 7f811a7 commit abae1cc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ConsoleWhisper/Module/FileHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ internal static class FileHelper {
internal static async Task DownloadFFmpegandModel(Argument arg) {
try {
FFmpeg.SetExecutablesPath(AppDirectory);

var tasks = new List<Task>() {
Task.Run(DownloadFFmpeg),
Task.Run(() => DownloadModel(arg.ModelType))
Expand Down Expand Up @@ -138,6 +138,8 @@ internal static class FileHelper {

#region downloader
private static async Task DownloadFFmpeg() {
FFmpeg.SetExecutablesPath(AppDirectory);

if (!FFmpegExists()) {
Output.Warn($"FFmpeg not found, start downloading.");
await FFmpegDownloader.GetLatestVersion(FFmpegVersion.Official);
Expand All @@ -154,10 +156,13 @@ internal static class FileHelper {

#region Check if necessary file exists
private static bool ModelExists(string modelFilename) {
Output.Success(ModelDirectory);
return File.Exists(Path.Combine(ModelDirectory, modelFilename));
}

private static bool FFmpegExists() {
Output.Success(FFmpegLocation);
Output.Success(FFprobeLocation);
return File.Exists(FFmpegLocation) && File.Exists(FFprobeLocation);
}
#endregion
Expand Down

0 comments on commit abae1cc

Please sign in to comment.