Skip to content

Add a speech fallback to the audio check - #264

Merged
jserv merged 1 commit into
sysprog21:mainfrom
liehcheng:codex/issue-44-speech-fallback
Oct 9, 2026
Merged

jserv merged 1 commit into
sysprog21:mainfrom
liehcheng:codex/issue-44-speech-fallback

Conversation

@liehcheng

@liehcheng liehcheng commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

On the Acer system reported in #44, the preflight's pure tone becomes inaudible with microphone capture and playback noise reduction active, while interviewer speech remains audible. Keep the tone and add a "Can't hear the tone?" control that plays a short speech sample. Candidates still confirm output with "I heard it", and the preflight offers guidance about playback noise reduction and audio enhancements.

The included test-voice.wav was generated using TTSMaker voice 148, Alayna (US English), and converted from MP3 to 24 kHz, 16-bit mono PCM. The asset's README records its source, voice, spoken text, format and licensing link. Users play the included file without generating speech or installing a synthesis engine. Replay uses one media element, failures remain retryable, and playback stops on leaving, starting the interview, or switching back to the tone. The server serves the embedded file as audio/wav.

Validation: cargo build --release --locked and ./scripts/test.sh passed using local Windows/WSL adapters. All six Chromium speech regression tests passed, and a separate check verified the current release's embedded audio and preflight playback flow. The contributor confirmed that the shipped speech sample is audible. Seventeen Rust tests remained ignored.

Closes #44


Summary by cubic

Adds a speech fallback to the preflight audio check for systems where playback noise reduction silences the pure tone while preserving speech.

Candidates who can't hear the tone can now play a bundled speech sample via a new "Can't hear the tone?" button, which relabels to "Play speech again" after the first play. Output is still confirmed with "I heard it", now applying to either tone or speech, and the preflight shows guidance about noise reduction and audio enhancements.

  • Ships a local test-voice.wav so no external service or synthesis engine is needed; the server serves it as audio/wav.
  • Playback failures are retryable, and speech stops when leaving the preflight, starting the interview, or switching back to the tone.
  • Adds six browser tests covering replay, retry, missing asset, switching, and stop behavior.
  • The CI workflow and a unit test verify the embedded voice is served as audio/wav and matches the shipped file.

Written for commit 5128b85. Summary will update on new commits.

View guided diff

cubic-dev-ai[bot]

This comment was marked as resolved.

Comment thread web/audio/README.md Outdated
Comment thread web/interview.js
try {
nodes.audioTestVoice.pause();
nodes.audioTestVoice.currentTime = 0;
await nodes.audioTestVoice.play();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

After the WAV fails to load once (a dropped connection, a server restart), the element keeps MEDIA_ERR_SRC_NOT_SUPPORTED, and every later play() rejects with NotSupportedError without fetching again. The error listener's "Reload the page" hint fires first. This catch then overwrites it with "Try again", which can never succeed. Reload the source when the element is in an error state.

Suggested change
await nodes.audioTestVoice.play();
if (nodes.audioTestVoice.error) nodes.audioTestVoice.load();
await nodes.audioTestVoice.play();

Playback noise reduction can suppress a pure test tone while preserving
speech. Offer a local speech sample with explicit candidate confirmation
so the output check remains useful without relying on external services
or changing microphone processing.

Closes sysprog21#44
@liehcheng
liehcheng force-pushed the codex/issue-44-speech-fallback branch from f720d4e to 5128b85 Compare October 9, 2026 03:57
@jserv
jserv requested review from ColtenOuO and alanhc October 9, 2026 04:35

@ColtenOuO ColtenOuO left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM.

@jserv
jserv merged commit ab78b3e into sysprog21:main Oct 9, 2026
6 checks passed
@jserv

jserv commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Thank @liehcheng for contributing!

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.

Play test tone is silent; interviewer voice is always audible

3 participants