Repository navigation
feat(audio-captions): alert possible wrong microphone when webspeech - #25342
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (5)
WalkthroughA microphone alert is added to the WebSpeech audio captions flow. A new Estimated code review effort: 3 (Moderate) | ~20 minutes Related issue: Sequence Diagram(s)sequenceDiagram
participant AudioManager
participant AudioCaptionsSpeechContainer
participant AudioCaptionsSpeech
participant hark
participant Toasts
AudioManager->>AudioCaptionsSpeechContainer: _inputStream
AudioCaptionsSpeechContainer->>AudioCaptionsSpeech: inputStream prop
AudioCaptionsSpeech->>hark: init(inputStream, settings)
hark->>AudioCaptionsSpeech: speaking event
AudioCaptionsSpeech->>AudioCaptionsSpeech: start speaking timer
hark->>AudioCaptionsSpeech: stopped_speaking event
AudioCaptionsSpeech->>AudioCaptionsSpeech: clear timer
AudioCaptionsSpeech->>Toasts: show microphoneAlert warning
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
bigbluebutton-html5/imports/ui/components/audio/audio-graphql/audio-captions/speech/component.tsx (1)
380-388: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winKeep the new alert fully self-contained in
audioCaptions.microphoneAlert.This effect still pulls
window.meetingClientSettings.public.app.mutedAlert.interval, so changing the muted-mic alert silently retunes this WebSpeech alert too. Please addintervalto the newmicrophoneAlertconfig and read it from there instead. That keeps the new config surface aligned with the PR’s “similar semantics” goal.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@bigbluebutton-html5/imports/ui/components/audio/audio-graphql/audio-captions/speech/component.tsx` around lines 380 - 388, The audioCaptions microphone alert effect is still depending on the muted-mic alert interval from window.meetingClientSettings.public.app.mutedAlert, which couples the two alert configs. Add interval to MICROPHONE_ALERT_CONFIG (or the audioCaptions.microphoneAlert config) and update the component in speech/component.tsx to read interval from that config alongside threshold, speakingThreshold, duration, and helpLink. Keep the harkInstanceRef.current setup self-contained so changes to mutedAlert no longer affect the new alert.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@bigbluebutton-html5/imports/ui/components/audio/audio-graphql/audio-captions/speech/component.tsx`:
- Around line 390-406: The speaking timeout in the speech captions component is
only anchored once on the first `speaking` event, so the no-transcription
warning can be skipped during long continuous speech. Update the
`harkInstanceRef.current.on('speaking', ...)` flow in the speech component to
restart or re-arm `speakingTimerRef` after each transcription event, using
`lastTranscriptionAtRef` as the moving baseline instead of a one-time
`speakingStartedAt` capture. Make sure the alert logic still respects
`alertShownRef`, `helpLink`, and `notify`, but schedules a fresh window whenever
new transcription arrives.
---
Nitpick comments:
In
`@bigbluebutton-html5/imports/ui/components/audio/audio-graphql/audio-captions/speech/component.tsx`:
- Around line 380-388: The audioCaptions microphone alert effect is still
depending on the muted-mic alert interval from
window.meetingClientSettings.public.app.mutedAlert, which couples the two alert
configs. Add interval to MICROPHONE_ALERT_CONFIG (or the
audioCaptions.microphoneAlert config) and update the component in
speech/component.tsx to read interval from that config alongside threshold,
speakingThreshold, duration, and helpLink. Keep the harkInstanceRef.current
setup self-contained so changes to mutedAlert no longer affect the new alert.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: ae54a9e1-1ddc-4433-992a-c6789eae4a42
📒 Files selected for processing (5)
bigbluebutton-html5/imports/ui/Types/meetingClientSettings.tsbigbluebutton-html5/imports/ui/components/audio/audio-graphql/audio-captions/speech/component.tsxbigbluebutton-html5/imports/ui/core/initial-values/meetingClientSettings.tsbigbluebutton-html5/private/config/settings.ymlbigbluebutton-html5/public/locales/en.json
There was a problem hiding this comment.
Pull request overview
Adds a WebSpeech-specific “microphone not transcribing” warning to help users diagnose cases where in-meeting audio uses a different mic than the browser’s WebSpeech input, resulting in speech activity but no captions.
Changes:
- Introduces new
audioCaptions.microphoneAlertconfiguration (enable flag, thresholds, duration, optional help link). - Adds English locale strings for the new toast message and optional “Learn more” label.
- Implements microphone-alert detection in the WebSpeech captions component using
harkon the current inputMediaStream.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| bigbluebutton-html5/public/locales/en.json | Adds i18n strings for the microphone alert toast message and help label. |
| bigbluebutton-html5/private/config/settings.yml | Adds audioCaptions.microphoneAlert settings (enabled, helpLink, thresholds, duration). |
| bigbluebutton-html5/imports/ui/Types/meetingClientSettings.ts | Extends the client settings types to include microphoneAlert under audioCaptions. |
| bigbluebutton-html5/imports/ui/core/initial-values/meetingClientSettings.ts | Provides initial/default values for the new microphoneAlert settings. |
| bigbluebutton-html5/imports/ui/components/audio/audio-graphql/audio-captions/speech/component.tsx | Implements the alert logic (speaking detection + “no transcription for N ms” toast) and wires in the input stream. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2ebf454 to
ed664f3
Compare
The microphone used by the webspeech API and the one use to in-meeting communication might differ if the default microphone in the OS is not the one used in the meeting. In this scenario, a user would speak, the talking indicator would confirm the microphone is correct, but webspeech would not generate any transcription for the person, because the internally selected microphone in the browser is not correct. Add a new mechanism that raises a toast notification alert when a user speaks(has floor) for a specific time(`audioCaptions.microphoneAlert.speakingThreshold`) with no transcription generated. The alert consists of a message pointing to a wrong microphone selection in the browser/OS level - with the possibility to show a link to a "learn more"(`audioCaptions.microphoneAlert.helpLink`) page with directions of how to fix/change that - OR that the user microphone is correct but has too much background noise. The other configurations under `audioCaptions.microphoneAlert` follow roughly the same semantics of the muted alert.
ed664f3 to
d0aeb48
Compare
|
✅ Automated tests have passed! |



What does this PR do?
The microphone used by the webspeech API and the one use to in-meeting communication might differ if the default microphone in the OS is not the one used in the meeting. In this scenario, a user would speak, the talking indicator would confirm the microphone is correct, but webspeech would not generate any transcription for the person, because the internally selected microphone in the browser is not correct.
Add a new mechanism that raises a toast notification alert when a user speaks(has floor) for a specific
time(
audioCaptions.microphoneAlert.speakingThreshold) with no transcription generated. The alert consists of a message pointing to a wrong microphone selection in the browser/OS level - with the possibility to show a link to a "learnmore"(
audioCaptions.microphoneAlert.helpLink) page with directions of how to fix/change that - OR that the user microphone is correct but has too much background noise. The other configurations underaudioCaptions.microphoneAlertfollow roughly the same semantics of the muted alert.Closes Issue(s)
Closes #24637
How to test