From eabb06d90f261a81e5681b15e72ea6b5a481e7dd Mon Sep 17 00:00:00 2001 From: BOT Alex <44818698+MagicBOTAlex@users.noreply.github.com> Date: Mon, 17 Jul 2023 14:08:47 +0800 Subject: [PATCH] Added multi-platform speech of cchars --- CCharLearn/Pages/Learn.razor | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CCharLearn/Pages/Learn.razor b/CCharLearn/Pages/Learn.razor index fdf9354..a180e2b 100644 --- a/CCharLearn/Pages/Learn.razor +++ b/CCharLearn/Pages/Learn.razor @@ -378,7 +378,7 @@ if (firstRender) { // Gets chinese voice on windows or iphone. - this.SpeechVoice = ((IEnumerable)(await this.SpeechSynthesis.GetVoicesAsync())).FirstOrDefault(v => v.Name.Contains("Yaoyao") || v.Name.Contains("Ting-Ting")); + this.SpeechVoice = ((IEnumerable)(await this.SpeechSynthesis.GetVoicesAsync())).FirstOrDefault(v => v.Name.Contains("Yaoyao") || v.Name.Contains("Ting-Ting") || v.Name.ToLower().Contains("cn")); this.StateHasChanged(); } } @@ -387,7 +387,7 @@ { if (SpeechVoice == null) { - Snackbar.Add("Couldn't play sound", Severity.Error); + Snackbar.Add("Couldn't play sound.\nLikely reason: Chinese speech not installed", Severity.Error); return; }