Skip to content

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

Closed
harshitethic wants to merge 2 commits into
openai:mainfrom
harshitethic:fix/voice-pcm16-little-endian
Closed

fix(voice): decode provider PCM16 as little-endian#4884
harshitethic wants to merge 2 commits into
openai:mainfrom
harshitethic:fix/voice-pcm16-little-endian

Conversation

@harshitethic

Copy link
Copy Markdown

Summary

Decode provider PCM16 bytes with an explicit little-endian dtype instead of the host-native np.int16 interpretation, then normalize to native int16 before returning audio to callers.

This fixes the big-endian-host corruption described in #4816 while preserving the existing np.int16 / np.float32 output shapes and odd-byte padding behavior.

Tests

Adds focused coverage using b"\x01\x02\x03\x04", which must decode to samples [513, 1027] for both integer and float output paths.

Closes #4816

AI assistance disclosure: AI assistance was used to inspect the issue, prepare the focused implementation and regression tests, and review the resulting diff.

@seratch

seratch commented Sep 7, 2026

Copy link
Copy Markdown
Member

Thanks for the contribution. #4817 already addresses #4816 with the same little-endian decode and native-int16 conversion.

@seratch seratch closed this Sep 7, 2026
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

2 participants