Skip to content

Conversation

@ao-anam
Copy link
Contributor

@ao-anam ao-anam commented Oct 15, 2025

Summary by cubic

Enable dynamic mic switching while streaming. Adds a new API to change the input audio device and emits an event when it changes.

  • New Features
    • Added AnamClient.changeAudioInputDevice(deviceId) to switch input device during an active stream.
    • Validates streaming state and input audio enabled; requires a deviceId.
    • Stops current track, requests new stream with the deviceId, replaces the peer connection track, and preserves the mute state.
    • Emits AnamEvent.INPUT_AUDIO_DEVICE_CHANGED with deviceId; EventCallbacks updated.

Copilot AI review requested due to automatic review settings October 15, 2025 11:10
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 pull request adds functionality to change the input audio device during an active streaming session. The implementation allows users to switch between different microphones or audio input devices without interrupting the streaming connection.

Key changes:

  • Added new event type for audio device change notifications
  • Implemented core device switching logic in StreamingClient
  • Exposed public API method through AnamClient with proper validation

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/types/events/public/AnamEvent.ts Added INPUT_AUDIO_DEVICE_CHANGED enum value
src/types/events/public/EventCallbacks.ts Added callback type for input audio device change event
src/modules/StreamingClient.ts Implemented changeAudioInputDevice method with stream replacement logic
src/AnamClient.ts Added public API method with validation checks

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

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.

No issues found across 4 files

@ao-anam ao-anam merged commit 8e093b7 into main Oct 15, 2025
3 checks passed
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