SubtitleEdit/subtitleedit · error · PlatformNotSupportedException

Process.Start() is not supported on this platform.

Error message

Process.Start() is not supported on this platform.

What it means

PlatformNotSupportedException thrown in Piper.StartPiperProcess when the OS is not Windows, Linux, macOS, or iOS. Piper is launched as an external process and Process.Start is only attempted on those four platforms; anything else (e.g., FreeBSD, Android) hits this throw.

Source

Thrown at src/ui/Features/Video/TextToSpeech/Engines/Piper.cs:299

                WorkingDirectory = GetSetPiperFolder(),
                FileName = GetPiperExecutableFileName(),
                // -f is quoted: the output file now lives in the caller's run folder (an absolute
                // path that can contain spaces), not a bare GUID name in the piper folder.
                Arguments = $"-m \"{voice.ModelShort}\" -c \"{voice.ConfigShort}\" -f \"{outputFileName}\"",
                UseShellExecute = false,
                CreateNoWindow = true,
                RedirectStandardInput = true,
                RedirectStandardError = true,
            }
        };

        if (OperatingSystem.IsWindows() || OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || OperatingSystem.IsIOS())
        {
            _ = processPiper.Start();
        }
        else
        {
            throw new PlatformNotSupportedException("Process.Start() is not supported on this platform.");
        }

        var streamWriter = new StreamWriter(processPiper.StandardInput.BaseStream, new UTF8Encoding(false));
        streamWriter.Write(inputText);
        streamWriter.Flush();
        streamWriter.Close();

        return processPiper;
    }

    public Task<string[]> GetRegions()
    {
        return Task.FromResult(Array.Empty<string>());
    }

    public Task<string[]> GetModels()
    {
        return Task.FromResult(Array.Empty<string>());

View on GitHub (pinned to 17a9f07487)

Solutions

  1. Hide or disable the Piper engine on unsupported platforms in the engine-selection UI.
  2. If the platform supports process spawning (e.g., FreeBSD with a piper binary), add it to the OS check: OperatingSystem.IsFreeBSD().
  3. Pre-generate audio on a supported platform and import the results.
  4. Use a different TTS engine that does not require spawning an external process.

Example fix

// before — four-platform guard
if (OperatingSystem.IsWindows() || OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || OperatingSystem.IsIOS())
    _ = processPiper.Start();
else
    throw new PlatformNotSupportedException("Process.Start() is not supported on this platform.");

// after — check capabilities rather than enumerating OS names
if (OperatingSystem.IsWindows() || OperatingSystem.IsLinux() || OperatingSystem.IsMacOS())
    _ = processPiper.Start();
else
    throw new PlatformNotSupportedException(
        $"Piper requires process spawning, which is not available on {Environment.OSVersion.Platform}.");
Defensive patterns

Strategy: validation

Validate before calling

// Check platform before calling Speak
var isSupportedPlatform = OperatingSystem.IsWindows() || OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || OperatingSystem.IsIOS();
if (!isSupportedPlatform)
    throw new PlatformNotSupportedException("Piper is not supported on this platform.");

Type guard

null

Try / catch

catch (PlatformNotSupportedException)
{
    // Piper cannot run here. Offer an alternative engine.
    await ShowWarning("Piper requires Windows, Linux, macOS, or iOS. Select a different TTS engine.");
}

Prevention

When it happens

Trigger: StartPiperProcess is called (from Speak) and none of the four OS checks (IsWindows, IsLinux, IsMacOS, IsIOS) return true. Note iOS is included here (unlike OmniVoiceTtsCpp), but Piper would still need to be compiled for iOS which is unlikely in practice.

Common situations: Running SE on an unsupported platform and selecting the Piper engine; an Avalonia cross-platform build that exposes Piper on an OS where no piper binary exists; Android build where Process.Start is not viable.

Related errors


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