-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 support for sink id #1300
add support for sink id #1300
Conversation
thanks @johnryan. some problems reported by build: https://travis-ci.org/katspaugh/wavesurfer.js/builds/329266525#L631 can you fix those? |
audio.src = URL.createObjectURL(dest.stream); | ||
audio.setSinkId(deviceId); | ||
} | ||
} |
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.
@johnryan why are you creating a new Audio instance here? Can the regular one not be (re-)used?
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.
@thijstriemstra which instance are you referring to? The webaudio apis don't support the setSinkId
concept so I create an HTMLAudioElement and attach the stream to that.
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.
I see: https://stackoverflow.com/a/43069474
Unfortunately, setting the destination audio device of a webaudio graph isn't yet implemented, and the api for this is not yet finalized.
What you can do for now, is connect the webaudio graph to an HTML element, and set the sinkid of the element (currently works on Chrome only)
Can you add a summary of that in a multiline comment so it's clear why you're doing that?
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.
And I would also throw errors instead of showing the warning, console.log is not used inside the library itself.
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.
@thijstriemstra done
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.
Awesome, thanks.
src/wavesurfer.js
Outdated
/** | ||
* Set the playback volume. | ||
* | ||
* @param {number} deviceId String value representing underlying output device |
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.
if it's a string, document param as string.
fixes #1293