Improve iOS Safari voice input with better error handling and debugging
Some checks failed
CI/CD Pipeline / Lint and Test (push) Has been cancelled
CI/CD Pipeline / E2E Tests (push) Has been cancelled
CI/CD Pipeline / Build Application (push) Has been cancelled

- Force MediaRecorder fallback for all iOS Safari devices
- Add iOS device detection to avoid Web Speech API on iOS
- Support multiple audio formats (webm, mp4, default) for compatibility
- Add comprehensive error logging throughout the flow
- Improve error messages with specific guidance for each error type
- Add console logging to track microphone permissions and recording state
- Better handling of getUserMedia permissions

This should help diagnose and fix the "Failed to recognize speech" error
by ensuring iOS Safari uses the MediaRecorder path with proper permissions.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-10-02 06:03:24 +00:00
parent 330c776124
commit 26d3f8962f
2 changed files with 76 additions and 15 deletions

View File

@@ -53,6 +53,7 @@ export function VoiceInputButton({
}, [transcript, isListening, isProcessing]);
const handleOpen = () => {
console.log('[VoiceButton] Opening dialog, isSupported:', isSupported, 'usesFallback:', usesFallback);
if (!isSupported) {
alert('Voice input is not supported in your browser. Please use Chrome, Edge, or Safari.');
return;
@@ -72,6 +73,7 @@ export function VoiceInputButton({
};
const handleStartListening = () => {
console.log('[VoiceButton] Starting listening, usesFallback:', usesFallback);
reset();
setClassificationResult(null);
startListening();