Skip to content

Conversation

@zachkrall
Copy link
Member

Add deviceId to AudioConstraints and speakerDeviceId to ConnectOptions to allow users to specify audio input and output devices.


Slack Thread

Open in Cursor Open in Web

@cursor
Copy link

cursor bot commented Oct 22, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@vercel
Copy link

vercel bot commented Oct 22, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
empathic-voice-api-js-next-app Ready Ready Preview Comment Oct 24, 2025 3:43pm

@zachkrall zachkrall marked this pull request as ready for review October 22, 2025 17:59
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for specifying audio input and output devices when connecting to EVI, allowing users to select specific microphones and speakers for their sessions.

Key changes:

  • Introduced DeviceOptions type with microphoneDeviceId and speakerDeviceId fields
  • Updated connect() to accept device IDs and pass them to the audio player and microphone initialization
  • Added device selector UI to the example application demonstrating the new functionality

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/react/src/models/connect-options.ts Added DeviceOptions type and included it in ConnectOptions
packages/react/src/lib/useSoundPlayer.ts Modified initPlayer to accept and configure speaker device via setSinkId
packages/react/src/lib/VoiceProvider.tsx Updated connect to extract device options and pass them to audio initialization
packages/react/README.md Added documentation for DeviceOptions and formatting improvements
packages/react/MIGRATION.md Formatting changes to markdown (bold text and list styles)
examples/next-app/components/ExampleComponent.tsx Added device enumeration and selector UI to demonstrate device selection
README.md Table formatting alignment fix

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

if (audioOutputs.length > 0 && !selectedSpeakerId) {
setSelectedSpeakerId(audioOutputs[0].deviceId);
}
} catch {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we update this to close the microphone stream once we get the device IDs?

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.

3 participants