From 44d6b3a2160eaa05955f35b29d242cea46e13f9e Mon Sep 17 00:00:00 2001 From: Talon Date: Sun, 6 Mar 2022 02:33:17 +0100 Subject: [PATCH] Fix crashes --- stardew-access/ScreenReader/ScreenReaderMac.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/stardew-access/ScreenReader/ScreenReaderMac.cs b/stardew-access/ScreenReader/ScreenReaderMac.cs index 7709b63..22d5ae6 100644 --- a/stardew-access/ScreenReader/ScreenReaderMac.cs +++ b/stardew-access/ScreenReader/ScreenReaderMac.cs @@ -88,11 +88,18 @@ namespace stardew_access.ScreenReader private void Speak(string text, bool interupt) { + if (_speakProcess.HasExited) { + InitializeScreenReader(); + } if (interupt) { _speakProcess.StandardInput.WriteLine("x"); } - _speakProcess.StandardInput.WriteLine($"s{text}"); + var lines = text.Split("\n").ToArray(); + foreach (var line in lines) { + _speakProcess.StandardInput.WriteLine($"s{line}"); + } + } } } \ No newline at end of file