aboutsummaryrefslogtreecommitdiff
path: root/ext/mixed/js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mixed/js')
-rw-r--r--ext/mixed/js/audio.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/ext/mixed/js/audio.js b/ext/mixed/js/audio.js
index b905140c..5e3b9164 100644
--- a/ext/mixed/js/audio.js
+++ b/ext/mixed/js/audio.js
@@ -58,3 +58,16 @@ async function audioGetFromSources(expression, sources, optionsContext, createAu
}
return {audio: null, source: null};
}
+
+function audioGetTextToSpeechVoice(voiceURI) {
+ try {
+ for (const voice of speechSynthesis.getVoices()) {
+ if (voice.voiceURI === voiceURI) {
+ return voice;
+ }
+ }
+ } catch (e) {
+ // NOP
+ }
+ return null;
+}