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 experimental option to pipe attached audio tracks through webaudio API #446

Merged
merged 9 commits into from
Oct 6, 2022

Conversation

lukasIO
Copy link
Contributor

@lukasIO lukasIO commented Sep 23, 2022

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Sep 23, 2022

🦋 Changeset detected

Latest commit: 405f613

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
livekit-client Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Member

@davidzhao davidzhao left a comment

Choose a reason for hiding this comment

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

lg, I'll figure out a way to make testing audio a bit easier via the CLI.

setAudioContext(audioContext: AudioContext) {
this.audioContext = audioContext;
if (this.attachedElements.length > 0) {
this.setupWebAudio(audioContext, this.attachedElements[0]);
Copy link
Member

Choose a reason for hiding this comment

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

if attached to multiple elements, do we only need to handle the first one?

Copy link
Member

Choose a reason for hiding this comment

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

or would it be a limitation that it only handles a single audio element?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

for webaaudio we only need one element, as we're actually not interested in the element, but rather in the mediastream attached with it. we wouldn't want to pipe the same audio track multiple times into web audio

Copy link
Contributor Author

Choose a reason for hiding this comment

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

but just realised detach logic is still missing...

Copy link
Member

Choose a reason for hiding this comment

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

good call!

@lukasIO lukasIO merged commit 88743d4 into main Oct 6, 2022
@lukasIO lukasIO deleted the lukas/webaudio-mix branch October 6, 2022 10:52
@github-actions github-actions bot mentioned this pull request Oct 6, 2022
max-b pushed a commit to Invisv-Privacy/client-sdk-js that referenced this pull request Dec 5, 2022
…o API (livekit#446)

* add option to pipe attached audio tracks through webaudio api

* use logger

* detach logic

* reconnect if still attached

* set nodes to undefined

* cleanup

* add method to set additional audionodes that plugin between track and destination

* changeset

* only reconnect webaudio if needed
max-b pushed a commit to Invisv-Privacy/client-sdk-js that referenced this pull request Dec 5, 2022
…o API (livekit#446)

* add option to pipe attached audio tracks through webaudio api

* use logger

* detach logic

* reconnect if still attached

* set nodes to undefined

* cleanup

* add method to set additional audionodes that plugin between track and destination

* changeset

* only reconnect webaudio if needed
max-b pushed a commit to Invisv-Privacy/client-sdk-js that referenced this pull request Dec 9, 2022
…o API (livekit#446)

* add option to pipe attached audio tracks through webaudio api

* use logger

* detach logic

* reconnect if still attached

* set nodes to undefined

* cleanup

* add method to set additional audionodes that plugin between track and destination

* changeset

* only reconnect webaudio if needed
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.

2 participants