{"record":{"id":"313a9f88ed74fc14","repo":"SubtitleEdit/subtitleedit","slug":"process-start-is-not-supported-on-this-platform","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/OmniVoiceTtsCpp.cs","lineNumber":448,"sourceCode":"\n        var voicesFolder = GetSetVoicesFolder();\n        var baseName = Path.GetFileNameWithoutExtension(fileName);\n        var destinationFileName = GetUniqueDestinationFileName(voicesFolder, baseName, \".wav\");\n\n        if (Path.GetExtension(fileName).Equals(\".wav\", StringComparison.OrdinalIgnoreCase))\n        {\n            File.Copy(fileName, destinationFileName, overwrite: false);\n        }\n        else\n        {\n            var process = FfmpegGenerator.ConvertFormat(fileName, destinationFileName);\n            if (OperatingSystem.IsWindows() || OperatingSystem.IsLinux() || OperatingSystem.IsMacOS())\n            {\n                _ = process.Start();\n            }\n            else\n            {\n                throw new PlatformNotSupportedException(\"Process.Start() is not supported on this platform.\");\n            }\n            process.WaitForExit();\n        }\n\n        // Pair the imported WAV with a sibling .txt holding the transcript. Without it\n        // omnivoice-tts will reject --ref-wav.\n        var destTextFile = Path.ChangeExtension(destinationFileName, \".txt\");\n        if (!string.IsNullOrWhiteSpace(transcript))\n        {\n            File.WriteAllText(destTextFile, transcript);\n        }\n        else\n        {\n            var sourceTextFile = Path.ChangeExtension(fileName, \".txt\");\n            if (File.Exists(sourceTextFile) && !File.Exists(destTextFile))\n            {\n                File.Copy(sourceTextFile, destTextFile, overwrite: false);\n            }","sourceCodeStart":430,"sourceCodeEnd":466,"githubUrl":"https://github.com/SubtitleEdit/subtitleedit/blob/17a9f0748781032255db3526b7215d2fb891e3af/src/ui/Features/Video/TextToSpeech/Engines/OmniVoiceTtsCpp.cs#L430-L466","documentation":"PlatformNotSupportedException thrown during OmniVoiceTtsCpp.ImportVoice when the source voice file is not already a .wav and the code falls into the ffmpeg conversion branch. Process.Start() is only called on Windows, Linux, or macOS; any other platform (e.g., FreeBSD, a custom OS) hits this throw.","triggerScenarios":"ImportVoice is called with a non-WAV file (triggering FfmpegGenerator.ConvertFormat), and OperatingSystem.IsWindows() && IsLinux() && IsMacOS() all return false. The only supported conversion platforms are Windows, Linux, and macOS.","commonSituations":"Running SE on an unsupported platform (FreeBSD, Solaris, etc.) and importing a non-WAV voice file; iOS/Android builds of an Avalonia app that include this engine but cannot spawn ffmpeg.","solutions":["Pre-convert the voice file to WAV (24 kHz mono) using an external tool before importing, so the ffmpeg branch is not hit.","If the platform genuinely needs to be supported, implement an alternative audio conversion path (e.g., an in-process library like NAudio or FFmpeg.AutoGen without Process.Start).","Gate the engine selection in the UI so it is not offered on unsupported platforms.","On iOS (which IS supported for Piper but not here), extend the OS check if ffmpeg is bundled."],"exampleFix":"// before — only Win/Linux/Mac can convert\nif (OperatingSystem.IsWindows() || OperatingSystem.IsLinux() || OperatingSystem.IsMacOS())\n    _ = process.Start();\nelse\n    throw new PlatformNotSupportedException(\"Process.Start() is not supported on this platform.\");\n\n// after — require a pre-converted WAV on unsupported platforms\nif (OperatingSystem.IsWindows() || OperatingSystem.IsLinux() || OperatingSystem.IsMacOS())\n{\n    _ = process.Start();\n}\nelse\n{\n    throw new PlatformNotSupportedException(\n        \"Voice import on this platform requires a pre-converted 24 kHz mono WAV file.\");\n}","handlingStrategy":"validation","validationCode":"// Check platform before attempting non-WAV import\nvar isConversionPlatform = OperatingSystem.IsWindows() || OperatingSystem.IsLinux() || OperatingSystem.IsMacOS();\nif (!isConversionPlatform && !fileName.EndsWith(\".wav\", StringComparison.OrdinalIgnoreCase))\n    throw new PlatformNotSupportedException(\"Pre-convert voice to WAV on this platform.\");","typeGuard":"null","tryCatchPattern":"catch (PlatformNotSupportedException)\n{\n    // Cannot convert on this platform. Inform user to provide a pre-converted WAV.\n    await ShowWarning(\"Import a pre-converted 24 kHz mono WAV file instead.\");\n}","preventionTips":["Pre-convert voice files to 24 kHz mono WAV before importing on unsupported platforms.","Hide the OmniVoice TTS engine on platforms where neither the binary nor ffmpeg can run.","Document the WAV format requirement (24 kHz mono) for manual conversion."],"tags":["platform","tts","omnivoice","voice-import","csharp"],"backgroundTag":null,"analyzedSha":"17a9f0748781032255db3526b7215d2fb891e3af","analyzedAt":"2026-08-13T18:11:43.374Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}