{ if ($user.role === 'admin') { await updateConfigHandler(); } saveSettings({ audio: { STTEngine: STTEngine !== '' ? STTEngine : undefined, TTSEngine: TTSEngine !== '' ? TTSEngine : undefined, speaker: speaker !== '' ? speaker : undefined, model: model !== '' ? model : undefined } }); 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 (Web API)')}
{$i18n.t('Whisper (Local)')}
{$i18n.t('Conversation Mode')}
{ toggleConversationMode(); }} type="button" > {#if conversationMode === true}
{$i18n.t('On')}
{:else}
{$i18n.t('Off')}
{/if}
{$i18n.t('Auto-send input after 3 sec.')}
{ 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(); speaker = '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) => v.localService === true) as voice}
{voice.name}
{/each}
{: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')}