Fix crashes

master
Talon 2022-03-06 02:33:17 +01:00
parent 2c845abb23
commit 44d6b3a216
1 changed files with 8 additions and 1 deletions

View File

@ -88,11 +88,18 @@ namespace stardew_access.ScreenReader
private void Speak(string text, bool interupt) private void Speak(string text, bool interupt)
{ {
if (_speakProcess.HasExited) {
InitializeScreenReader();
}
if (interupt) if (interupt)
{ {
_speakProcess.StandardInput.WriteLine("x"); _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}");
}
} }
} }
} }