From 89ba89b65fb47222920ad223a1147adb19a74462 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Tue, 4 Mar 2025 08:37:34 -0500 Subject: [PATCH 1/2] Update Plugin Count --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 84c5c5b0..a3c78de3 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ You can join our [discord server](https://discord.gg/5Xh2W87egW) for commits, ch ### Extra included plugins
-150 additional plugins +151 additional plugins ### All Platforms - AllCallTimers by MaxHerbold & D3SOX From e58149d55edc7433527c1f72121698f4b1942e06 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Tue, 4 Mar 2025 09:03:26 -0500 Subject: [PATCH 2/2] This Is Actually Stupid But Works --- src/plugins/vcNarrator/index.tsx | 42 ++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/src/plugins/vcNarrator/index.tsx b/src/plugins/vcNarrator/index.tsx index 730ecb32..45d41c81 100644 --- a/src/plugins/vcNarrator/index.tsx +++ b/src/plugins/vcNarrator/index.tsx @@ -39,25 +39,36 @@ interface VoiceState { const VoiceStateStore = findByPropsLazy("getVoiceStatesForChannel", "getCurrentClientVoiceChannelId"); +function getVoices(): Promise { + return new Promise(resolve => { + let voices: SpeechSynthesisVoice[] = window.speechSynthesis.getVoices(); + if (voices.length) { + resolve(voices); + return; + } + + window.speechSynthesis.onvoiceschanged = () => { + voices = window.speechSynthesis.getVoices(); + resolve(voices); + }; + }); +} +getVoices().then(resolvedVoices => { + const voiceList = resolvedVoices.map(v => ({ + label: v.name, + value: v.voiceURI, + default: v.default + })); + // @ts-ignore + settings.def.voice.options.push(...voiceList); + console.log(voiceList); +}); + const settings = definePluginSettings({ voice: { type: OptionType.SELECT, description: "Narrator Voice", - options: [ - { - label: "Microsoft David - English (United States)", - value: "Microsoft David - English (United States)", - default: true - }, - { - label: "Microsoft Mark - English (United States)", - value: "Microsoft Mark - English (United States)" - }, - { - label: "Microsoft Zira - English (United States)", - value: "Microsoft Zira - English (United States)" - } - ], + options: [], }, volume: { type: OptionType.SLIDER, @@ -245,6 +256,7 @@ export default definePlugin({ }, start() { + console.log(settings.store.voice); if (typeof speechSynthesis === "undefined" || speechSynthesis.getVoices().length === 0) { new Logger("VcNarrator").warn( "SpeechSynthesis not supported or no Narrator voices found. Thus, this plugin will not work. Check my Settings for more info"