Skip to content

fix(voice): decode provider PCM16 as little-endian - #4817

Open
Hughhhhcoder wants to merge 1 commit into
openai:mainfrom
Hughhhhcoder:codex/openai-agents-python-pcm-byte-order
Open

fix(voice): decode provider PCM16 as little-endian#4817
Hughhhhcoder wants to merge 1 commit into
openai:mainfrom
Hughhhhcoder:codex/openai-agents-python-pcm-byte-order

Conversation

@Hughhhhcoder

Copy link
Copy Markdown
Contributor

Summary

TTS providers return PCM16 bytes in a fixed little-endian wire format, but StreamedAudioResult decoded them with native np.int16. On big-endian hosts this swapped every non-symmetric sample before returning audio to callers. The decoder now uses explicit <i2 input and normalizes to native np.int16, preserving the existing float32 conversion, chunk framing, odd-byte padding, and output API.

Test plan

Passed:

  • uv run pytest tests/voice/test_pipeline.py -q (57 passed)
  • make lint
  • uv run mypy src/agents/voice/result.py
  • uv run pyright --project pyrightconfig.json src/agents/voice/result.py
  • make tests-serial (77 passed, 4 skipped)
  • git diff --check

The repository-wide verification wrapper was run. make format and lint passed. The repository-wide typecheck remains blocked by 9 pre-existing errors in src/agents/function_schema.py, src/agents/sandbox/apply_patch.py, src/agents/models/openai_responses.py, and src/agents/extensions/memory/redis_session.py; none are in this change. The parallel make tests run completed with 9300 passed, 14 skipped, and 6 unrelated failures in PTY timing, MCP schema/field compatibility, and the legacy-httpx import test.

Issue number

Closes #4816

Checks

  • I've added new tests, if relevant
  • I've run .agents/skills/code-change-verification/scripts/run.sh
  • I've confirmed all verification steps pass
  • If using Codex, I've run /review before submitting this PR

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-02T03:13:17.301956Z 9f7ba18 PR opened
🔒 Security Review Completed 2026-09-02T03:13:48.983721Z 9f7ba18 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

fix(voice): decode provider PCM16 with explicit little-endian byte order

1 participant