SubtitleEdit/subtitleedit · error · PlatformNotSupportedException

Operation is not supported on this platform.

Error message

Operation is not supported on this platform.

What it means

Thrown by GetUrlTranslate2, which only has URLs for three targets: Windows (any arch), macOS ARM64, and Linux x64. Any combination outside those three (Linux ARM64, macOS Intel/x64, FreeBSD, or any other OS) falls through to the parameterless PlatformNotSupportedException. It fires from DownloadWhisperCTranslate2 before the HTTP request.

Source

Thrown at src/ui/Logic/Download/WhisperDownloadService.cs:127

    private static string GetUrlTranslate2()
    {
        if (OperatingSystem.IsWindows())
        {
            return WindowCTranslate2;
        }
        
        if (OperatingSystem.IsMacOS() && RuntimeInformation.ProcessArchitecture == Architecture.Arm64)
        {
            return MacArmCTranslate2;
        }
        
        if (OperatingSystem.IsLinux() && RuntimeInformation.ProcessArchitecture == Architecture.X64)
        {
            return LinuxCTranslate2;
        }

        throw new PlatformNotSupportedException();
    }

    private static string GetUrlCppVulkan()
    {
        if (OperatingSystem.IsWindows())
        {
            return WindowsUrlCppVulkan;
        }

        throw new PlatformNotSupportedException();
    }
    
    private static string GetUrl()
    {
        if (OperatingSystem.IsWindows())
        {
            return WindowsUrl;
        }

View on GitHub (pinned to 17a9f07487)

Solutions

  1. On macOS Intel use whisper.cpp (GetUrl serves MacX64Url) or run CTranslate2 under Rosetta on Apple Silicon.
  2. On Linux ARM64 pick an engine that ships an aarch64 or universal build, or build whisper-ctranslate2 locally.
  3. Extend GetUrlTranslate2 to return a URL for the missing platform if you publish your own CTranslate2 build.
  4. Gate the CTranslate2 option in the engine picker on the supported platform set.

Example fix

// before
return LinuxCTranslate2; // only reached for Linux x64
...
throw new PlatformNotSupportedException();

// after: add an explicit, message-bearing branch so callers know what is missing
if (OperatingSystem.IsMacOS() && RuntimeInformation.ProcessArchitecture == Architecture.X64)
{
    throw new PlatformNotSupportedException("CTranslate2 has no macOS Intel build; use whisper.cpp.");
}
throw new PlatformNotSupportedException($"CTranslate2 not supported on {RuntimeInformation.OSDescription}/{RuntimeInformation.ProcessArchitecture}.");
Defensive patterns

Strategy: validation

Validate before calling

bool CTranslate2Supported() =>
    OperatingSystem.IsWindows() ||
    (OperatingSystem.IsMacOS() && RuntimeInformation.ProcessArchitecture == Architecture.Arm64) ||
    (OperatingSystem.IsLinux() && RuntimeInformation.ProcessArchitecture == Architecture.X64);

Type guard

static bool IsCTranslate2PlatformSupported() =>
    OperatingSystem.IsWindows() ||
    (OperatingSystem.IsMacOS() && RuntimeInformation.ProcessArchitecture == Architecture.Arm64) ||
    (OperatingSystem.IsLinux() && RuntimeInformation.ProcessArchitecture == Architecture.X64);

Try / catch

try { await svc.DownloadWhisperCTranslate2(stream, progress, ct); }
catch (PlatformNotSupportedException) { /* fall back to whisper.cpp */ }

Prevention

When it happens

Trigger: Calling DownloadWhisperCTranslate2 on macOS x64 (Intel Mac), Linux ARM64, or any non-Windows/non-mac/non-Linux-x64 OS such as FreeBSD.

Common situations: An Intel Mac user or a Raspberry Pi / Graviton Linux user selects the CTranslate2 (GPU/CPU-fp) Whisper engine. The mapping table has no row for that platform.

Related errors


AI-assisted analysis of SubtitleEdit/subtitleedit@17a9f07487 (2026-08-13). Data as JSON: /api/errors/c98806b82321ccba. Report an issue: GitHub.