Skip to content

feat: implement STT and TTS foundation using Expo libraries#1

Merged
Debashich merged 10 commits into
mainfrom
feat/voice-foundation
Apr 19, 2026
Merged

feat: implement STT and TTS foundation using Expo libraries#1
Debashich merged 10 commits into
mainfrom
feat/voice-foundation

Conversation

@Debashich

Copy link
Copy Markdown
Owner

Basic Testing Checklist

  • Onboarding: "Welcome to Clara" plays upon OnboardingScreen mount (audible at 50%+ device volume).
  • Prompts: Mic button triggers "Go ahead, speak now" before listening begins.
  • Auto-play: Assistant responses speak automatically immediately after a message is sent.

Mic Button Behavior

  • Activation Flow: Press mic → TTS prompt plays → 100ms delay → STT activates (red indicator visible).
  • Real-time Feedback: Transcript appears on-screen while speaking into the device.
  • Toggle: Pressing again or releasing stops the listening state.
  • Audio Quality: Zero audio overlap or crackling between the end of TTS and the start of STT. [1, 2]

Expected Console Logs

[TTS] Initializing TTS engine...
[TTS] Speaking: Welcome to Clara
[TTS] Speech started
[STT] Checking microphone permission...
[STT] Starting voice recognition...
[STT] Transcript captured: [user speech]
[TTS] Speech completed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements an initial Speech-to-Text (STT) and Text-to-Speech (TTS) foundation for the app using Expo libraries, wiring speech prompts and voice capture into onboarding and the home chat flow.

Changes:

  • Added TTS/STT service wrappers and hooks (useTTS, useSTT) backed by expo-speech and expo-speech-recognition.
  • Integrated speech behaviors into OnboardingScreen (welcome + mic prompt + transcript-to-answer) and HomeScreen (mic prompt + transcript-to-message + auto TTS reply).
  • Updated project config: Android permissions, new dependencies, and a postinstall script to patch module tsconfigs.

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
test.md Added a planning/architecture doc for speech structure and phases.
src/services/speech/tts.ts Implements Expo Speech wrapper with initialization/logging and speech control.
src/services/speech/stt.ts Implements Expo speech-recognition wrapper with permission handling and event listeners.
src/hooks/useTTS.ts Hook to initialize and expose speak/stop APIs.
src/hooks/useSTT.ts Hook to manage listening state and transcript updates via STT service.
src/screens/OnboardingScreen.tsx Adds welcome TTS, mic-driven STT, and transcript display/answer updates.
src/screens/HomeScreen.tsx Adds mic-driven STT, auto-send from transcript, and auto TTS assistant reply.
src/constants/voice.ts Introduces shared TTS voice configuration.
scripts/postinstall-fixes.js Adds install-time patching of dependency tsconfig files.
package.json Adds speech deps + postinstall script + related tooling deps.
app.json Adds Android permissions required/used by speech features.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test.md
Comment thread scripts/postinstall-fixes.js
Comment thread src/services/speech/stt.ts Outdated
Comment thread src/screens/OnboardingScreen.tsx Outdated
Comment thread src/screens/HomeScreen.tsx Outdated
Comment thread src/services/speech/tts.ts Outdated
Comment thread src/services/speech/stt.ts Outdated
Comment thread src/hooks/useSTT.ts
Comment thread src/screens/HomeScreen.tsx
Comment thread app.json Outdated
Debashich and others added 2 commits April 19, 2026 22:09
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Debashich/Clara/sessions/629175aa-9816-4f8e-ace0-0dd8136fcee7

Co-authored-by: Debashich <178707367+Debashich@users.noreply.github.com>

Copilot AI commented Apr 19, 2026

Copy link
Copy Markdown

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.expo.dev
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/Clara/Clara/node_modules/.bin/expo start --web --non-interactive --port 8081 de/node/bin/git (dns block)
  • cdp.expo.dev
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/Clara/Clara/node_modules/.bin/expo start --web --non-interactive --port 8081 de/node/bin/git (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Debashich and others added 2 commits April 19, 2026 22:34
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Debashich and others added 5 commits April 19, 2026 22:34
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Debashich

Copy link
Copy Markdown
Owner Author

@copilot verify all updates

Copilot AI commented Apr 19, 2026

Copy link
Copy Markdown

@copilot verify all updates

Verified all implemented updates on 5ca7707 (plus prior related commits in this branch):

  • Mic flow sequencing is correct in Onboarding and Home (TTS prompt completes → 100ms delay → STT starts).
  • Latest workflow runs show no failed jobs.
  • Local TypeScript validation passes (npx tsc --noEmit).

Screenshot: UI screenshot

@Debashich Debashich merged commit c5b2f23 into main Apr 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants