Skip to content

Conversation

@mukherja04
Copy link
Contributor

Encapsulated all flag checking logic in scribearRecognizer

@angrave angrave requested a review from bennettrwu December 8, 2025 21:00
mic_stream = await navigator.mediaDevices.getUserMedia({ audio: true, video: false });
} catch (e) {
console.error('Failed to access microphone', e);
try { store.dispatch({ type: 'SET_MIC_INACTIVITY', payload: true }); } catch (_) {}
Copy link
Contributor

Choose a reason for hiding this comment

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

try/catch here seems unnecessary, since dispatch shouldn't throw an error when used correctly. If it is, could you put some error handling in the catch?

// update last audio timestamp and mark that we've received at least one audio chunk
this.lastAudioTimestamp = Date.now();
try { (window as any).__lastAudioTimestamp = this.lastAudioTimestamp; } catch (e) {}
try { (window as any).__hasReceivedAudio = true; if ((window as any).__initialAudioTimer) { clearTimeout((window as any).__initialAudioTimer); (window as any).__initialAudioTimer = null; } } catch (e) {}
Copy link
Contributor

Choose a reason for hiding this comment

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

__lastAudioTimestamp, __hasReceivedAudio, __initialAudioTimer appear to be unused. Can we remove these setters here?

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