feat: add ConversationAudioObserver for mic and agent audio - #215
Merged
Conversation
renal128
force-pushed
the
audio-observers
branch
from
July 20, 2026 10:29
95654ee to
f48ddd5
Compare
renal128
force-pushed
the
audio-observers
branch
from
July 20, 2026 10:59
f48ddd5 to
ced3b10
Compare
renal128
force-pushed
the
audio-observers
branch
from
July 20, 2026 13:38
ced3b10 to
c0dfabf
Compare
renal128
force-pushed
the
audio-observers
branch
from
July 20, 2026 14:38
c0dfabf to
4a72bc5
Compare
renal128
force-pushed
the
audio-observers
branch
from
July 20, 2026 15:54
4a72bc5 to
0784de9
Compare
renal128
force-pushed
the
audio-observers
branch
from
July 20, 2026 16:20
0784de9 to
766d65a
Compare
renal128
force-pushed
the
audio-observers
branch
2 times, most recently
from
July 20, 2026 17:07
48cf638 to
d1acd8d
Compare
renal128
force-pushed
the
audio-observers
branch
2 times, most recently
from
July 20, 2026 22:32
8b49bd5 to
ab9f9cd
Compare
renal128
force-pushed
the
audio-observers
branch
3 times, most recently
from
July 21, 2026 12:28
f0fb4ba to
51cd5ec
Compare
renal128
force-pushed
the
audio-observers
branch
3 times, most recently
from
July 21, 2026 22:44
3e01a48 to
648be4b
Compare
renal128
force-pushed
the
audio-observers
branch
2 times, most recently
from
July 22, 2026 13:21
db18f3c to
a772bc5
Compare
renal128
force-pushed
the
audio-observers
branch
from
July 22, 2026 15:31
a772bc5 to
02a3d92
Compare
jacksonh
approved these changes
Jul 23, 2026
jacksonh
left a comment
Contributor
There was a problem hiding this comment.
This looks very useful.
renal128
force-pushed
the
audio-observers
branch
from
July 23, 2026 09:06
02a3d92 to
196d344
Compare
renal128
force-pushed
the
audio-observers
branch
from
July 23, 2026 09:10
196d344 to
8c2effb
Compare
3 tasks
renal128
force-pushed
the
audio-observers
branch
from
August 4, 2026 15:47
8c2effb to
5fc2adf
Compare
renal128
force-pushed
the
audio-observers
branch
from
August 4, 2026 16:38
5fc2adf to
27ed8e2
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 27ed8e2. Configure here.
renal128
force-pushed
the
audio-observers
branch
from
August 4, 2026 18:33
27ed8e2 to
be8d3c3
Compare
Expose durable mic and agent audio observers with optional level analysis while keeping real-time callbacks off the main actor. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
renal128
force-pushed
the
audio-observers
branch
from
August 4, 2026 18:38
be8d3c3 to
ffd0362
Compare
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.

What
ConversationAudioObserverfor observing decoded PCM from agent output or the local microphone.ConversationClient:addAgentAudioObserver/removeAgentAudioObserveraddMicAudioObserver/removeMicAudioObserverAudioRenderer/AudioTrackfully internal behindAudioObserverRegistry.Why
Apps need raw audio for visualization, recording, or custom analysis without:
@PublishedupdatesUsage
Behavior
didReceive(_:)receives a borrowed, read-only buffer on the audio callback path.ConversationClient;Conversationitself is single-use.Testing
swift test --filter 'AudioObserverRegistryTests|ConversationAudioObserverTests|ConversationClientTests'Note
Medium Risk
New public audio callback API runs on the real-time audio path and changes teardown ordering around WebRTC disconnect; behavior is covered by unit tests but misuse in observers could affect audio performance.
Overview
Adds a public
ConversationAudioObserverprotocol so apps can tap decoded PCM from agent output and local mic for visualization, recording, or analysis without LiveKit types on the SDK surface.ConversationClientexposes durableadd/removeAPIs for agent and mic observers; registrations are re-bound on each new session whenbindruns.Conversationowns per-sessionAudioObserverRegistryinstances that bridge observers to internal LiveKitAudioRendereradapters, reattach on track swaps, and reset on teardown.WebRTCConnectionManagersurfacesonTracksChangedfrom LiveKit publish/subscribe/unpublish events and types tracks asAudioTrackProtocolinternally. Session end / startup failure paths tear down observers beforedisconnect()and useisTearingDownso stale track callbacks cannot re-attach after cleanup.Reviewed by Cursor Bugbot for commit ffd0362. Bugbot is set up for automated code reviews on this repo. Configure here.