{"record":{"id":"0a23f207a395705e","repo":"SubtitleEdit/subtitleedit","slug":"process-start-is-not-supported-on-this-platform-0a23f2","errorCode":null,"errorMessage":"Process.Start() is not supported on this platform.","messagePattern":"Process\\.Start\\(\\) is not supported on this platform\\.","errorType":"exception","errorClass":"PlatformNotSupportedException","httpStatus":null,"severity":"error","filePath":"src/ui/Features/Video/TextToSpeech/Engines/Piper.cs","lineNumber":299,"sourceCode":"                WorkingDirectory = GetSetPiperFolder(),\n                FileName = GetPiperExecutableFileName(),\n                // -f is quoted: the output file now lives in the caller's run folder (an absolute\n                // path that can contain spaces), not a bare GUID name in the piper folder.\n                Arguments = $\"-m \\\"{voice.ModelShort}\\\" -c \\\"{voice.ConfigShort}\\\" -f \\\"{outputFileName}\\\"\",\n                UseShellExecute = false,\n                CreateNoWindow = true,\n                RedirectStandardInput = true,\n                RedirectStandardError = true,\n            }\n        };\n\n        if (OperatingSystem.IsWindows() || OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || OperatingSystem.IsIOS())\n        {\n            _ = processPiper.Start();\n        }\n        else\n        {\n            throw new PlatformNotSupportedException(\"Process.Start() is not supported on this platform.\");\n        }\n\n        var streamWriter = new StreamWriter(processPiper.StandardInput.BaseStream, new UTF8Encoding(false));\n        streamWriter.Write(inputText);\n        streamWriter.Flush();\n        streamWriter.Close();\n\n        return processPiper;\n    }\n\n    public Task<string[]> GetRegions()\n    {\n        return Task.FromResult(Array.Empty<string>());\n    }\n\n    public Task<string[]> GetModels()\n    {\n        return Task.FromResult(Array.Empty<string>());","sourceCodeStart":281,"sourceCodeEnd":317,"githubUrl":"https://github.com/SubtitleEdit/subtitleedit/blob/17a9f0748781032255db3526b7215d2fb891e3af/src/ui/Features/Video/TextToSpeech/Engines/Piper.cs#L281-L317","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Hide or disable the Piper engine on unsupported platforms in the engine-selection UI.","If the platform supports process spawning (e.g., FreeBSD with a piper binary), add it to the OS check: OperatingSystem.IsFreeBSD().","Pre-generate audio on a supported platform and import the results.","Use a different TTS engine that does not require spawning an external process."],"exampleFix":"// before — four-platform guard\nif (OperatingSystem.IsWindows() || OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || OperatingSystem.IsIOS())\n    _ = processPiper.Start();\nelse\n    throw new PlatformNotSupportedException(\"Process.Start() is not supported on this platform.\");\n\n// after — check capabilities rather than enumerating OS names\nif (OperatingSystem.IsWindows() || OperatingSystem.IsLinux() || OperatingSystem.IsMacOS())\n    _ = processPiper.Start();\nelse\n    throw new PlatformNotSupportedException(\n        $\"Piper requires process spawning, which is not available on {Environment.OSVersion.Platform}.\");","handlingStrategy":"validation","validationCode":"// Check platform before calling Speak\nvar isSupportedPlatform = OperatingSystem.IsWindows() || OperatingSystem.IsLinux() || OperatingSystem.IsMacOS() || OperatingSystem.IsIOS();\nif (!isSupportedPlatform)\n    throw new PlatformNotSupportedException(\"Piper is not supported on this platform.\");","typeGuard":"null","tryCatchPattern":"catch (PlatformNotSupportedException)\n{\n    // Piper cannot run here. Offer an alternative engine.\n    await ShowWarning(\"Piper requires Windows, Linux, macOS, or iOS. Select a different TTS engine.\");\n}","preventionTips":["Disable or hide the Piper engine selection on unsupported platforms.","If the platform supports process spawning (e.g., FreeBSD), add it to the OS check.","Provide an alternative in-process TTS engine for unsupported platforms."],"tags":["platform","tts","piper","csharp"],"backgroundTag":null,"analyzedSha":"17a9f0748781032255db3526b7215d2fb891e3af","analyzedAt":"2026-08-13T18:11:43.374Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}