Skip to content

Commit

Permalink
Use different WhisperXXL for Win7 - thx Purfview :)
Browse files Browse the repository at this point in the history
Related to  #9095
  • Loading branch information
niksedk committed Dec 18, 2024
1 parent 8a34674 commit a0bede7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ui/Forms/AudioToText/WhisperDownload.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public sealed partial class WhisperDownload : Form
};

private const string DownloadUrlPurfviewFasterWhisperXxl = "https://github.com/Purfview/whisper-standalone-win/releases/download/Faster-Whisper-XXL/Faster-Whisper-XXL_r239.1_windows.7z";
private const string DownloadUrlPurfviewFasterWhisperXxlWin7 = "https://github.com/Purfview/whisper-standalone-win/releases/download/Faster-Whisper-XXL/Faster-Whisper-XXL_r192.3.4_windows.7z";
// private const string DownloadUrlPurfviewFasterWhisperXxl = "https://github.com/SubtitleEdit/support-files/releases/download/whispercpp-172/test.7z";

private static readonly string[] Sha512HashesPurfviewFasterWhisperXxl =
Expand Down Expand Up @@ -131,6 +132,11 @@ public WhisperDownload(string whisperChoice)
_whisperChoice = whisperChoice;
}

private static bool IsWindows7()
{
return Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Minor == 1;
}

private void WhisperDownload_Shown(object sender, EventArgs e)
{
if (_whisperChoice == WhisperChoice.PurfviewFasterWhisperXxl)
Expand All @@ -139,7 +145,8 @@ private void WhisperDownload_Shown(object sender, EventArgs e)
using (var downloadStream = new FileStream(_tempFileName, FileMode.Create, FileAccess.Write))
using (var httpClient = DownloaderFactory.MakeHttpClient())
{
var downloadTask = httpClient.DownloadAsync(DownloadUrlPurfviewFasterWhisperXxl, downloadStream, new Progress<float>((progress) =>
var url = IsWindows7() ? DownloadUrlPurfviewFasterWhisperXxlWin7 : DownloadUrlPurfviewFasterWhisperXxl;
var downloadTask = httpClient.DownloadAsync(url, downloadStream, new Progress<float>((progress) =>
{
var pct = (int)Math.Round(progress * 100.0, MidpointRounding.AwayFromZero);
labelPleaseWait.Text = LanguageSettings.Current.General.PleaseWait + " " + pct + "%";
Expand Down

0 comments on commit a0bede7

Please sign in to comment.