{ saveSettings({ audio: { STTEngine: STTEngine !== '' ? STTEngine : undefined, TTSEngine: TTSEngine !== '' ? TTSEngine : undefined, speaker: speaker !== '' ? speaker : 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'; } else { getWebAPIVoices(); speaker = ''; } }} >
{$i18n.t('Default (Web API)')}
{$i18n.t('Open AI')}
{$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')}
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}
{voice.name}
{/each}
{/if}
Save