Skip to content

Fix voice input STT fallback handling - #31

Merged
jubaoliang merged 1 commit into
mainfrom
agent/fix-voice-input-stt
Jul 21, 2026
Merged

Fix voice input STT fallback handling#31
jubaoliang merged 1 commit into
mainfrom
agent/fix-voice-input-stt

Conversation

@Pandakingxbc

Copy link
Copy Markdown
Collaborator

Summary

Fix voice input STT fallback handling.

This PR prevents Browser Native speech recognition from getting stuck in the “transcribing” state when the browser ends recognition without returning a result. It now resolves cleanly on onend, times out after 15 seconds, and handles SpeechRecognition.start() errors.

It also improves cross-browser recording handling by checking MediaRecorder support, using better uploaded audio filenames for WebM/MP4/Ogg/WAV, and automatically switching to a newly configured server-side STT provider when the active STT is still Browser Native.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Refactor / chore

Test plan

  • make all passes locally
  • Added/updated tests

Verified with:

  • make lint
  • ./node_modules/.bin/tsc -b
  • ./node_modules/.bin/eslint src/hooks/useVoiceInput.ts
  • Manual voice input check: Browser Native no longer stays stuck in “识别中”

Checklist

  • Updated CHANGELOG.md (if user-facing)
  • README / docs updated (if needed)

@jubaoliang
jubaoliang merged commit 43c251f into main Jul 21, 2026
5 checks 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.

2 participants