Skip to content

fix(voice): honor WAV sample width - #4361

Merged
seratch merged 1 commit into
openai:mainfrom
FU-max-boop:agent/honor-audio-sample-width
Aug 11, 2026
Merged

fix(voice): honor WAV sample width#4361
seratch merged 1 commit into
openai:mainfrom
FU-max-boop:agent/honor-audio-sample-width

Conversation

@FU-max-boop

Copy link
Copy Markdown
Contributor

Summary

  • encode WAV frames according to the declared 1-, 2-, 3-, or 4-byte sample width
  • handle unsigned PCM8 and signed PCM24/PCM32 conversion for both int16 and float32 inputs
  • preserve the existing default PCM16 quantization and reject unsupported widths

Problem

VoicePipelineConfig exposes sample_width, and the WAV header already uses it, but frame bytes were always written as int16. For widths other than 2, the header and payload disagree, so readers interpret the audio with the wrong frame boundaries and values.

Validation

  • uv run pytest tests/voice/test_input.py -q — 19 passed
  • uv run pytest -q — 8170 passed, 33 skipped
  • Ruff check and format check
  • mypy and Pyright on src
  • git diff --check

@seratch seratch added this to the 0.20.x milestone Aug 11, 2026
@seratch
seratch merged commit 863b96c into openai:main Aug 11, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants