Skip to content
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

Merged
merged 5 commits into from
Jan 16, 2018
Merged

add support for sink id #1300

merged 5 commits into from
Jan 16, 2018

Conversation

johnryan
Copy link
Contributor

@johnryan johnryan commented Jan 15, 2018

fixes #1293

@thijstriemstra
Copy link
Contributor

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);
}
}
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Awesome, thanks.

/**
* Set the playback volume.
*
* @param {number} deviceId String value representing underlying output device
Copy link
Contributor

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.

@thijstriemstra thijstriemstra merged commit 43598bb into katspaugh:master Jan 16, 2018
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.

Ability to select audio output device
2 participants