Add HD realtime voice and repair live CI connection setup - #69
Merged
Conversation
dimavrem22
marked this pull request as ready for review
September 7, 2026 20:25
|
| Filename | Overview |
|---|---|
| inkbox_claude/audio.py | Introduces stateful mono PCM16 resampling and explicit negotiation for HD PCM and legacy μ-law call streams. |
| inkbox_claude/realtime.py | Converts call audio independently of the realtime API’s 24 kHz PCM session and resets outbound conversion state at playback boundaries. |
| inkbox_claude/gateway.py | Requests 16 kHz signed little-endian PCM for realtime calls and strengthens exact post-call SMS wording guidance. |
| tests/live/conftest.py | Enables bounded HTTP connection-establishment retries for credentialed live-test sessions. |
| pyproject.toml | Adds the conditional audioop compatibility dependency required on Python 3.13 and later. |
Sequence Diagram
sequenceDiagram
participant Caller
participant Inkbox as Inkbox Call WS
participant Bridge as Realtime Bridge
participant OpenAI as Realtime API
Caller->>Inkbox: Call audio
Inkbox->>Bridge: start(media_format)
Bridge->>Bridge: Configure per-direction converters
Inkbox->>Bridge: 16 kHz PCM or legacy 8 kHz PCMU
Bridge->>OpenAI: Resampled 24 kHz PCM
OpenAI->>Bridge: 24 kHz PCM response audio
Bridge->>Inkbox: Resampled negotiated call audio
Bridge->>Inkbox: audio_done / clear
Reviews (4): Last reviewed commit: "test: restore unassisted hosted voice re..." | Re-trigger Greptile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Executive Summary
Add HD realtime voice and repair connection setup failures in live checks.
Description
The realtime bridge advertises PCM16 in the call WebSocket handshake, reads the negotiated start descriptor, and keeps independent streaming conversion state for each direction. Partial samples survive frame boundaries; output state resets on interruption and audio completion. Unsupported formats fail explicitly instead of producing incorrectly encoded speech.
Live tests use bounded connection-establishment retries without retrying potentially delivered requests. The hosted-call peer makes its request once, without reminders or corrective coaching; exact action, recipient, marker, and single-send assertions remain unchanged. Python 3.13 joins the unit matrix to exercise the conditional audio conversion dependency.
Reason
Realtime voice should retain wideband call audio instead of forcing it through 8 kHz μ-law. Post-call reconciliation now explicitly preserves exact caller-specified SMS wording without replaying an accepted send. Recent live failures also exposed connection setup errors that can be retried safely without duplicating user actions.
Decisions
Testing
c0bf236: all 13 jobs and all 21 PR checks passed. The original single-request hosted scenario passed in 87 seconds, proving durable action registration before hangup, autonomous agent wakeup and confirmed SMS execution, completed post-call receipt, and exactly one current-marker SMS to the caller after the duplicate grace window. Realtime also verified negotiated 16 kHz PCM and two-way speech. Earlier reminder-assisted results are superseded.