Skip to content

Use default input sample rate for voice recording - #20788

Closed
bricelb wants to merge 1 commit into
NousResearch:mainfrom
bricelb:codex/voice-default-input-samplerate
Closed

Use default input sample rate for voice recording#20788
bricelb wants to merge 1 commit into
NousResearch:mainfrom
bricelb:codex/voice-default-input-samplerate

Conversation

@bricelb

@bricelb bricelb commented May 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Use the default input device sample rate for voice recording instead of forcing 16 kHz.

Why

Some audio devices do not support opening an input stream at 16 kHz directly. On those systems, voice recording can fail even though the input device exposes a usable native sample rate such as 44.1 kHz or 48 kHz.

Changes

  • Query the default input device's default_samplerate before opening the stream.
  • Use that sample rate for InputStream, short-recording threshold calculation, and WAV metadata.
  • Keep 16 kHz as a fallback when the backend does not expose a numeric device rate.
  • Treat SSH as a notice rather than a hard warning, since audio can be local to the target machine.

Validation

  • python3 -m py_compile tools/voice_mode.py
  • git diff --check

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have tool/tts Text-to-speech and transcription labels May 6, 2026
@bricelb

bricelb commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #61463 — same fix rebased on current main, with tests added per the contributing guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low — cosmetic, nice to have tool/tts Text-to-speech and transcription type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants