diff --git a/plugin-designs/rudder-voice/rudder-voice.vue b/plugin-designs/rudder-voice/rudder-voice.vue index 540d1e0dc..7f2bfb7b3 100644 --- a/plugin-designs/rudder-voice/rudder-voice.vue +++ b/plugin-designs/rudder-voice/rudder-voice.vue @@ -28,6 +28,16 @@ const cfg = computed(() => { try { return props.profileConfig ? JSON.parse(props.profileConfig) : {} } catch { return {} } }) const apiBase = computed(() => (cfg.value.apiBase || '/api/rudder').replace(/\/$/, '')) +// The engine records THIS computer's microphone, so it can only ever run beside the reader: on a laptop's +// dev server, or as the desktop app's sidecar. Served from anywhere else (a cloud dev server), an absent +// engine is the expected state, not a failure, and the notice says where Rudder does work. +const LOOPBACK = /^(localhost|127\.\d+\.\d+\.\d+|\[?::1\]?|tauri\.localhost)$/ +const onOwnComputer = computed(() => { + try { + if (/^https?:\/\//.test(apiBase.value)) return LOOPBACK.test(new URL(apiBase.value).hostname) + return typeof location === 'undefined' || location.protocol === 'tauri:' || LOOPBACK.test(location.hostname) + } catch { return true } +}) const LANGUAGES = [ ['en-US', 'English (US)'], ['en-GB', 'English (UK)'], ['es-US', 'Spanish (US)'], ['es-ES', 'Spanish (Spain)'], @@ -463,7 +473,7 @@ const statusText = computed(() => ({ starting: 'Loading speech model… (about 20 s the first time)', ready: recording.value ? 'Listening' : 'Ready', error: 'Engine error', - offline: 'Engine offline', + offline: onOwnComputer.value ? 'Engine offline' : 'Runs on your computer', }[engine.value] || engine.value)) @@ -561,6 +571,10 @@ const statusText = computed(() => ({

Also available but switched off in Sound settings: {{ offCards.join(', ') }}. Turn it on there to use it here.

{{ notice }}

+

+ Voice to text runs on your own computer, not on this server: it listens to the microphone of the machine + the engine runs on. Open the Plugin Studio on your computer (bun run dev) or use the Rudder desktop app. +

The local speech engine isn't reachable at {{ apiBase }}. In the Plugin Studio it starts with bun run dev once built: cd backend/rudder-engine && go build -o ../bin/rudder-engine .