From a0c6cbaf6a3b65b7c42e164e30d7aebe212dcab3 Mon Sep 17 00:00:00 2001 From: Esther Alter Date: Wed, 25 Oct 2023 11:59:13 -0400 Subject: [PATCH] Fixed a panic in SpeechDispatcher.voices() --- src/backends/speech_dispatcher.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/backends/speech_dispatcher.rs b/src/backends/speech_dispatcher.rs index 73f75a4..81aff57 100644 --- a/src/backends/speech_dispatcher.rs +++ b/src/backends/speech_dispatcher.rs @@ -188,6 +188,7 @@ impl Backend for SpeechDispatcher { .0 .list_synthesis_voices()? .iter() + .filter(|v| LanguageTag::parse(v.language.clone()).is_ok()) .map(|v| Voice { id: v.name.clone(), name: v.name.clone(),