Skip to content

chore: send_user_audio public#31

Merged
sebvanleuven merged 1 commit intomainfrom
fix/public_send_user_audio
Feb 10, 2026
Merged

chore: send_user_audio public#31
sebvanleuven merged 1 commit intomainfrom
fix/public_send_user_audio

Conversation

@sebvanleuven
Copy link
Contributor

@sebvanleuven sebvanleuven commented Feb 9, 2026

send_user_audio is a function that's interacted with. This should not be private and be exposed by the SDK.
This exposes this function and allows to send in audio streams directly.


Summary by cubic

Expose send_user_audio on the SDK client to let apps stream raw 16-bit PCM audio to Anam over WebRTC. Validates the connection and forwards audio to the streaming pipeline.

  • New Features
    • Added send_user_audio(audio_bytes, sample_rate, num_channels) to the public client; accepts mono or stereo PCM and raises SessionError if not connected.

Written for commit 217c04f. Summary will update on new commits.

@sebvanleuven sebvanleuven requested a review from ao-anam February 9, 2026 20:26
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="src/anam/client.py">

<violation number="1" location="src/anam/client.py:613">
P0: The underlying implementation of `send_user_audio` in `StreamingClient` (which this method delegates to) contains a critical bug: it calls `self._audio_transceiver.sender.replaceTrack(...)` without awaiting it. Since `replaceTrack` is a coroutine in `aiortc`, the track replacement will never execute, and no user audio will be transmitted.

You must either:
1. Update `StreamingClient.send_user_audio` to wrap the `replaceTrack` call in `asyncio.create_task()`.
2. Or change both this method and `StreamingClient.send_user_audio` to be `async` and await the call.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@sebvanleuven sebvanleuven changed the title send_user_audio public chore: send_user_audio public Feb 10, 2026
@sebvanleuven sebvanleuven merged commit 308b50e into main Feb 10, 2026
8 checks passed
@sebvanleuven sebvanleuven deleted the fix/public_send_user_audio branch February 11, 2026 14:14
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.

2 participants