{ if ($user.role === 'admin') { await updateConfigHandler(); } saveSettings({ audio: { STTEngine: STTEngine !== '' ? STTEngine : undefined, TTSEngine: TTSEngine !== '' ? TTSEngine : undefined, speaker: (TTSEngine === 'openai' ? OpenAISpeaker : speaker) !== '' ? TTSEngine === 'openai' ? OpenAISpeaker : speaker : undefined, model: model !== '' ? model : undefined, nonLocalVoices: nonLocalVoices } }); dispatch('save'); }} >
{$i18n.t('STT Settings')}
{$i18n.t('Speech-to-Text Engine')}
{ if (e.target.value !== '') { navigator.mediaDevices.getUserMedia({ audio: true }).catch(function (err) { toast.error( $i18n.t(`Permission denied when accessing microphone: {{error}}`, { error: err }) ); STTEngine = ''; }); } }} >
{$i18n.t('Default (Whisper)')}
{$i18n.t('Web API')}
{$i18n.t('Instant Auto-Send After Voice Transcription')}
{ toggleSpeechAutoSend(); }} type="button" > {#if speechAutoSend === true}
{$i18n.t('On')}
{:else}
{$i18n.t('Off')}
{/if}
{$i18n.t('TTS Settings')}
{$i18n.t('Text-to-Speech Engine')}
{ if (e.target.value === 'openai') { getOpenAIVoices(); OpenAISpeaker = 'alloy'; model = 'tts-1'; } else { getWebAPIVoices(); speaker = ''; } }} >
{$i18n.t('Default (Web API)')}
{$i18n.t('Open AI')}
{#if $user.role === 'admin'} {#if TTSEngine === 'openai'}
{/if} {/if}
{$i18n.t('Auto-playback response')}
{ toggleResponseAutoPlayback(); }} type="button" > {#if responseAutoPlayback === true}
{$i18n.t('On')}
{:else}
{$i18n.t('Off')}
{/if}
{#if TTSEngine === ''}
{$i18n.t('Set Voice')}
{$i18n.t('Default')}
{#each voices.filter((v) => nonLocalVoices || v.localService === true) as voice}
{voice.name}
{/each}
{$i18n.t('Allow non-local voices')}
{:else if TTSEngine === 'openai'}
{$i18n.t('Set Voice')}
{#each voices as voice}
{/each}
{$i18n.t('Set Model')}
{#each models as model}
{/each}
{/if}
{$i18n.t('Save')}