-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to set input stream #271
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @adamduren, thanks for the PR! This looks like useful functionality. Have you tested thoroughly on your end? I'd be worried about some potential edge cases regarding stream / track management, but otherwise I think this looks great. Left a couple small comments.
Once those and the PR checkpoints are addressed I think we can move forward. 🙂
* @param stream - A media stream to use as input | ||
* @param device - A device to use as input | ||
*/ | ||
private _setInputStream(stream: MediaStream, device: MediaDeviceInfo | null): Promise<void> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like we could nix the private method and put this logic in the public setInputStream
, and call that above instead?
@@ -317,6 +317,15 @@ class AudioHelper extends EventEmitter { | |||
'Related BugZilla thread: https://bugzilla.mozilla.org/show_bug.cgi?id=1299324')); | |||
} | |||
|
|||
/** | |||
* Replace the current input steamd with a new MediaStream. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sp: steamd -> stream
@ryan-rowland given that This is achieved using the WebAudio API to mix the user's selected input along with the AudioNode which can play the pre-recorded message. |
Contributing to Twilio
Pull Request Details
Description
Adds the ability to specify an input audio stream rather than limiting input selection to devices. If there is desire to accept this change I can continue to run through the steps below.
Burndown
Before review
npm test
Before merge