Skip to content

Expose conversation audio streams#714

Draft
kraenhansen wants to merge 5 commits into
mainfrom
cursor/expose-assistant-audio-stream-f579
Draft

Expose conversation audio streams#714
kraenhansen wants to merge 5 commits into
mainfrom
cursor/expose-assistant-audio-stream-f579

Conversation

@kraenhansen

@kraenhansen kraenhansen commented Apr 30, 2026

Copy link
Copy Markdown
Member

Summary

  • add abstract getInputAudioStream() and getOutputAudioStream() methods to the base conversation contract
  • expose user input and assistant output MediaStreams from voice conversations, including WebSocket and WebRTC paths
  • add symmetric onInputAudioStream / onOutputAudioStream callbacks
  • update React useConversationAudioStream() and useConversation() to return inputAudioStream and outputAudioStream
  • keep controller-level stream methods generic (getAudioStream, addAudioStreamListener, removeAudioStreamListener)
  • mark affected packages for minor release in the changeset

Testing

  • pnpm --filter @elevenlabs/client test --run src/utils/WebRTCConnection.test.ts
  • pnpm --filter @elevenlabs/react test --run src/conversation/ConversationAudioStream.test.tsx
  • pnpm --filter @elevenlabs/types build && pnpm --filter @elevenlabs/client build:esm && pnpm --filter @elevenlabs/react build:esm
  • pre-commit hook: pnpm lint
Open in Web Open in Cursor 

@kraenhansen kraenhansen changed the title Expose assistant audio streams Expose conversation audio streams Apr 30, 2026
@kraenhansen kraenhansen self-assigned this May 7, 2026
setMuted(isMuted: boolean): Promise<void>;
isMuted(): boolean;
/** Returns the user input audio stream, if one is available. */
getAudioStream(): MediaStream | null;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Doing this we're exposing a Web API type on our public API and I'm not completely convinced that's what we'd want to do 🤔

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.

Expose assistant audio stream via useConversation hook or conversation instance method

2 participants