#2545 Fix system tts pitch slider not working

22a7792bacad8a2966b92961dbc3045a97b64d6d

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +5 -5Ignore whitespace
public/scripts/extensions/tts/system.js+5 -5
@@ -97,9 +97,9 @@ class SystemTtsProvider {
9797
9898 return `<p>Uses the voices provided by your operating system</p>
9999 <label for="system_tts_rate">Rate: <span id="system_tts_rate_output"></span></label>
100100 <input id="system_tts_rate" type="range" value="${this.defaultSettings.rate}" min="0.51" max="2" step="0.101" />
101101 <label for="system_tts_pitch">Pitch: <span id="system_tts_pitch_output"></span></label>
102102 <input id="system_tts_pitch" type="range" value="${this.defaultSettings.pitch}" min="0" max="2" step="0.101" />`;
103103 }
104104
105105 onSettingsChange() {
@@ -147,7 +147,7 @@ class SystemTtsProvider {
147147
148148 // Trigger updates
149149 $('#system_tts_rate').on('input', () => { this.onSettingsChange(); });
150150 $('#system_tts_ratesystem_tts_pitch').on('input', () => { this.onSettingsChange(); });
151151
152152 $('#system_tts_pitch_output').text(this.settings.pitch);
153153 $('#system_tts_rate_output').text(this.settings.rate);
@@ -198,8 +198,8 @@ class SystemTtsProvider {
198198 const text = getPreviewString(voice.lang);
199199 const utterance = new SpeechSynthesisUtterance(text);
200200 utterance.voice = voice;
201201 utterance.rate = this.settings.rate || 1;
202202 utterance.pitch = this.settings.pitch || 1;
203203 speechSynthesis.speak(utterance);
204204 }
205205