{ saveSettings({ audio: { stt: { engine: STTEngine !== '' ? STTEngine : undefined, language: STTLanguage !== '' ? STTLanguage : undefined }, tts: { engine: TTSEngine !== '' ? TTSEngine : undefined, engineConfig: TTSEngineConfig, playbackRate: playbackRate, voice: voice !== '' ? voice : undefined, defaultVoice: $config?.audio?.tts?.voice ?? '', nonLocalVoices: $config.audio.tts.engine === '' ? nonLocalVoices : undefined } } }); dispatch('save'); }} >
{$i18n.t('Audio')}
{#if $config.audio.stt.engine !== 'web'}
{$i18n.t('Default')}
{$i18n.t('Web API')}
{/if}
{ toggleSpeechAutoSend(); }} type="button" role="switch" aria-checked={speechAutoSend} > {speechAutoSend === true ? $i18n.t('On') : $i18n.t('Off')}
{$i18n.t('Default')}
{$i18n.t('Kokoro.js (Browser)')}
{#if TTSEngine === 'browser-kokoro'}
{$i18n.t('Select dtype')}
fp32
fp16
q8
q4
{/if}
{ toggleResponseAutoPlayback(); }} type="button" role="switch" aria-checked={responseAutoPlayback} > {responseAutoPlayback === true ? $i18n.t('On') : $i18n.t('Off')}
x
{#if TTSEngine === 'browser-kokoro'} {#if TTSModel}
{#each voices as voice}
{voice.name}
{/each}
{:else}
{$i18n.t('Loading Kokoro.js...')} {TTSModelProgress && TTSModelProgress.status === 'progress' ? `(${Math.round(TTSModelProgress.progress * 10) / 10}%)` : ''}
{$i18n.t('Please do not close the settings page while loading the model.')}
{/if} {:else if $config.audio.tts.engine === ''}
{$i18n.t('Default')}
{#each voices.filter((v) => nonLocalVoices || v.localService === true) as _voice}
{_voice.name}
{/each}
{:else if $config.audio.tts.engine !== ''}
{#each voices as voice}
{voice.name}
{/each}
{/if}
{$i18n.t('Save')}