Improve iOS Safari voice input with better error handling and debugging
- 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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user