Skip to content

[FEATURE] Ability to set a MediaStream as an input #269

Open
@adamduren

Description

@adamduren

Is your feature request related to a problem? Please describe.
The Voice SDK is limited to selecting input devices that have a device id. While this works for most cases it would be great if developers had the flexibility to provide a stream as an input instead of a device. In the case of our application we mix the user's mic input with an additional audio source to provide additional context about the call session.

Describe the solution you'd like
It would be ideal if AudioHelper.setInputDevice could accept a device id or a MediaStream. Alternatively add an additional method AudioHelper.setInputStream. It appears the the device id is only used to build constraints to getUserMedia. The device does not appear to be used as well outside of automated testing from what I can tell.

I have tested this by forking the library and adding a method device.audio.setInputStream based on the implementation of AudioHelper._setInputDevice. I confirmed that it works as expected. Would be open to contributing this back to Twilio if a maintainer can provide a recommendation to their preferred implementation path.

Describe alternatives you've considered
I have tried to consider other solutions to achieve my desired outcome and thus far this appears to be the only path forward.

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions