#2545 Fix system tts pitch slider not working
| @@ -97,9 +97,9 @@ class SystemTtsProvider { | ||
| 97 | 97 | |
| 98 | 98 | return `<p>Uses the voices provided by your operating system</p> |
| 99 | 99 | <label for="system_tts_rate">Rate: <span id="system_tts_rate_output"></span></label> |
| 100 | 100 | <input id="system_tts_rate" type="range" value="${this.defaultSettings.rate}" min="0.51" max="2" step="0.101" /> |
| 101 | 101 | <label for="system_tts_pitch">Pitch: <span id="system_tts_pitch_output"></span></label> |
| 102 | 102 | <input id="system_tts_pitch" type="range" value="${this.defaultSettings.pitch}" min="0" max="2" step="0.101" />`; |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | onSettingsChange() { |
| @@ -147,7 +147,7 @@ class SystemTtsProvider { | ||
| 147 | 147 | |
| 148 | 148 | // Trigger updates |
| 149 | 149 | $('#system_tts_rate').on('input', () => { this.onSettingsChange(); }); |
| 150 | 150 | $('#system_tts_ratesystem_tts_pitch').on('input', () => { this.onSettingsChange(); }); |
| 151 | 151 | |
| 152 | 152 | $('#system_tts_pitch_output').text(this.settings.pitch); |
| 153 | 153 | $('#system_tts_rate_output').text(this.settings.rate); |
| @@ -198,8 +198,8 @@ class SystemTtsProvider { | ||
| 198 | 198 | const text = getPreviewString(voice.lang); |
| 199 | 199 | const utterance = new SpeechSynthesisUtterance(text); |
| 200 | 200 | utterance.voice = voice; |
| 201 | 201 | utterance.rate = this.settings.rate || 1; |
| 202 | 202 | utterance.pitch = this.settings.pitch || 1; |
| 203 | 203 | speechSynthesis.speak(utterance); |
| 204 | 204 | } |
| 205 | 205 | |