ef89d0f291
* Add regex filter option to TTS extension - Added checkbox to enable/disable regex filtering of TTS text - Added text input for custom regex patterns - Default pattern removes emojis and non-English text while preserving letters, numbers, spaces, and punctuation - Regex is applied after asterisk removal and other text processing - Includes error handling for invalid regex patterns - Automatically cleans up extra spaces after regex removal * reverted the accidental change in tts_skip_tags description clarified the regex description * Add regex validation warning to TTS settings * fixed regex field in UI * reworked the regex warning * changed the regex event to change (input might not have worked correctly) * Apply review comments * Spacing fix --------- Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
107 lines
6.4 KiB
HTML
107 lines
6.4 KiB
HTML
<div id="tts_settings">
|
|
<div class="inline-drawer">
|
|
<div class="inline-drawer-toggle inline-drawer-header">
|
|
<b>TTS</b>
|
|
<div class="inline-drawer-icon fa-solid fa-circle-chevron-down down"></div>
|
|
</div>
|
|
<div class="inline-drawer-content">
|
|
<div id="tts_status">
|
|
</div>
|
|
<span data-i18n="Select TTS Provider">Select TTS Provider</span>
|
|
<br>
|
|
<div class="tts_block">
|
|
<select id="tts_provider" class="flex1">
|
|
</select>
|
|
<input id="tts_refresh" data-i18n="[value]tts_refresh" class="menu_button" type="submit" value="Reload" />
|
|
</div>
|
|
<div>
|
|
<label class="checkbox_label" for="tts_enabled">
|
|
<input type="checkbox" id="tts_enabled" name="tts_enabled">
|
|
<small data-i18n="tts_enabled">Enabled</small>
|
|
</label>
|
|
<label class="checkbox_label" for="tts_narrate_user">
|
|
<input type="checkbox" id="tts_narrate_user">
|
|
<small data-i18n="Narrate user messages">Narrate user messages</small>
|
|
</label>
|
|
<label class="checkbox_label" for="tts_auto_generation">
|
|
<input type="checkbox" id="tts_auto_generation">
|
|
<small data-i18n="Auto Generation">Auto Generation</small>
|
|
</label>
|
|
<label class="checkbox_label" for="tts_periodic_auto_generation" data-i18n="[title]Requires auto generation to be enabled." title="Requires auto generation to be enabled.">
|
|
<input type="checkbox" id="tts_periodic_auto_generation">
|
|
<small data-i18n="Narrate by paragraphs (when streaming)">Narrate by paragraphs (when streaming)</small>
|
|
</label>
|
|
<label class="checkbox_label" for="tts_narrate_by_paragraphs">
|
|
<input type="checkbox" id="tts_narrate_by_paragraphs">
|
|
<small data-i18n="Narrate by paragraphs (when not streaming)">Narrate by paragraphs (when not streaming)</small>
|
|
</label>
|
|
<label class="checkbox_label" for="tts_narrate_quoted">
|
|
<input type="checkbox" id="tts_narrate_quoted">
|
|
<small data-i18n="Only narrate quotes">Only narrate "quotes"</small>
|
|
</label>
|
|
<label class="checkbox_label" for="tts_narrate_dialogues">
|
|
<input type="checkbox" id="tts_narrate_dialogues">
|
|
<small data-i18n="Ignore text, even quotes, inside asterisk">Ignore *text, even "quotes", inside asterisks*</small>
|
|
</label>
|
|
<label class="checkbox_label" for="tts_narrate_translated_only">
|
|
<input type="checkbox" id="tts_narrate_translated_only">
|
|
<small data-i18n="Narrate only the translated text">Narrate only the translated text</small>
|
|
</label>
|
|
<label class="checkbox_label" for="tts_skip_codeblocks">
|
|
<input type="checkbox" id="tts_skip_codeblocks">
|
|
<small data-i18n="Skip codeblocks">Skip codeblocks</small>
|
|
</label>
|
|
<label class="checkbox_label" for="tts_skip_tags">
|
|
<input type="checkbox" id="tts_skip_tags">
|
|
<small data-i18n="Skip tagged blocks">Skip <tagged> blocks</small>
|
|
</label>
|
|
<label class="checkbox_label" for="tts_pass_asterisks">
|
|
<input type="checkbox" id="tts_pass_asterisks">
|
|
<small data-i18n="Pass Asterisks to TTS Engine">Pass Asterisks to TTS Engine</small>
|
|
</label>
|
|
<label class="checkbox_label" for="tts_multi_voice_enabled"
|
|
data-i18n="[title]Works best when: Pass Asterisks to TTS Engine is enabled, and both Only narrate quotes and Ignore *text, even 'quotes', inside asterisks* are disabled."
|
|
title="Works best when: Pass Asterisks to TTS Engine is enabled, and both Only narrate quotes and Ignore *text, even 'quotes', inside asterisks* are disabled.">
|
|
<input type="checkbox" id="tts_multi_voice_enabled">
|
|
<small data-i18n="Different voices for quotes and text inside asterisks">
|
|
Different voices for "quotes", *text inside asterisks* and other text
|
|
</small>
|
|
</label>
|
|
<label class="checkbox_label" for="tts_apply_regex" title="Applies the regex pattern to filter text before TTS.">
|
|
<input type="checkbox" id="tts_apply_regex">
|
|
<small data-i18n="Apply regex filter">Apply regex filter to text</small>
|
|
</label>
|
|
<div id="tts_regex_block" class="marginTop5">
|
|
<div class="range-block-title justifyLeft">
|
|
<small data-i18n="Regex Pattern">Regex Pattern (removes matching text)</small>
|
|
</div>
|
|
<input type="text" id="tts_regex_pattern" class="text_pole width100p" placeholder="Example: /[^a-zA-Z0-9\s.,!?;:'"()]+/g" />
|
|
<small id="tts_regex_warning" class="warning" data-i18n="Invalid regex pattern.">Invalid regex pattern.</small>
|
|
</div>
|
|
</div>
|
|
<div id="playback_rate_block" class="range-block">
|
|
<hr>
|
|
<div class="range-block-title justifyLeft">
|
|
<small data-i18n="Audio Playback Speed">Audio Playback Speed</small>
|
|
</div>
|
|
<div class="range-block-range-and-counter">
|
|
<div class="range-block-range">
|
|
<input type="range" id="playback_rate" name="volume" min="0" max="3" step="0.05">
|
|
</div>
|
|
<div class="range-block-counter">
|
|
<input type="number" min="0" max="3" step="0.05" data-for="playback_rate" id="playback_rate_counter">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="tts_voicemap_block">
|
|
</div>
|
|
<hr>
|
|
<form id="tts_provider_settings">
|
|
</form>
|
|
<div class="tts_buttons">
|
|
<input id="tts_voices" class="menu_button" data-i18n="[value]Available voices" type="submit" value="Available voices" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|