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

Feat: Voice activity threshold #2556

Conversation

hugohutri
Copy link

@hugohutri hugohutri commented Aug 1, 2022

Adding voice activity detection feature

More information at element-hq/element-call#492

Notes: none


This change has no change notes, so will not be included in the changelog.

@github-actions github-actions bot added the Z-Community-PR Issue is solved by a community member's PR label Aug 1, 2022
Copy link
Member

@dbkr dbkr left a comment

Choose a reason for hiding this comment

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

I've left more feedback over on the element call PR, but specifically to this PR, remember to check for your editor reformatting files before committing.

Copy link
Contributor

@SimonBrandner SimonBrandner left a comment

Choose a reason for hiding this comment

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

Just a few nitpicks, we're getting really close with this!

One more tiny nit: we tend to write comments with a space after the slashes (i.e. // comment not //comment)

mediaStreamAudioSourceNode.connect(this.analyser);

const streamNode = this.audioContext.createMediaStreamSource(this.stream);
this.audioDelay = this.audioContext.createDelay(0.001);
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I think I probably wasn't clear - I was suggesting adding AUDIO_DELAY = 0.001; // ms at the top of a file and using it here - would that work?

src/webrtc/callFeed.ts Outdated Show resolved Hide resolved
spec/unit/webrtc/callFeed.spec.ts Outdated Show resolved Hide resolved
spec/unit/webrtc/callFeed.spec.ts Outdated Show resolved Hide resolved
spec/unit/webrtc/callFeed.spec.ts Outdated Show resolved Hide resolved
spec/unit/webrtc/callFeed.spec.ts Outdated Show resolved Hide resolved
DashieTM and others added 7 commits October 9, 2022 13:07
Co-authored-by: Šimon Brandner <simon.bra.ag@gmail.com>
Co-authored-by: Šimon Brandner <simon.bra.ag@gmail.com>
Co-authored-by: Šimon Brandner <simon.bra.ag@gmail.com>
Co-authored-by: Šimon Brandner <simon.bra.ag@gmail.com>
@DashieTM
Copy link

DashieTM commented Oct 9, 2022

Just a few nitpicks, we're getting really close with this!

One more tiny nit: we tend to write comments with a space after the slashes (i.e. // comment not //comment)

No worries, changed the ones in the tests.
Just so I don't make another new comment, I also put the audio delay on the same spot as the cooldown and treshold.
This number works ofc, just not the node itself :P

Copy link
Contributor

@SimonBrandner SimonBrandner left a comment

Choose a reason for hiding this comment

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

LGTM now! Will also request Dave's review, just to be sure

spec/unit/webrtc/callFeed.spec.ts Outdated Show resolved Hide resolved
Co-authored-by: Šimon Brandner <simon.bra.ag@gmail.com>
@SimonBrandner SimonBrandner added T-Task Tasks for the team like planning T-Enhancement and removed T-Task Tasks for the team like planning labels Oct 9, 2022
@DashieTM
Copy link

DashieTM commented Oct 9, 2022

LGTM now! Will also request Dave's review, just to be sure

Awesome!!
One thing though:
we likely need some human feedback on whether or not the settings like the cooldown and the quality are ok.
I will try to personally test this out with friends, but more people would always be nice.
(although I am behind a NAT with my low power server, so this will prob be a pain. Until now I have tested it locally.)

Is the intention to mass test this alongside other features in a hosted version of element-call?

@SimonBrandner
Copy link
Contributor

LGTM now! Will also request Dave's review, just to be sure

Awesome!! One thing though: we likely need some human feedback on whether or not the settings like the cooldown and the quality are ok. I will try to personally test this out with friends, but more people would always be nice. (although I am behind a NAT with my low power server, so this will prob be a pain. Until now I have tested it locally.)

Is the intention to mass test this alongside other features in a hosted version of element-call?

Hmm, I think this would be best to discuss over at element-call with Jake since he's the one on the product team. Sorry, for late response...

@DashieTM
Copy link

Hmm, I think this would be best to discuss over at element-call with Jake since he's the one on the product team. Sorry, for late response...

No worries, also got lot's of stuff to do :P

Copy link
Member

@dbkr dbkr left a comment

Choose a reason for hiding this comment

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

I was attempting to test this but I couldn't get it to work as it was NPEing on the local call feed:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'setVoiceActivityThreshold')
    at GroupCall.setVoiceActivityThreshold (groupCall.ts:556:35)
    at GroupCallView.tsx:92:15
    at commitHookEffectListMount (react-dom.development.js:23150:26)
    at commitPassiveMountOnFiber (react-dom.development.js:24926:13)
    at commitPassiveMountEffects_complete (react-dom.development.js:24891:9)
    at commitPassiveMountEffects_begin (react-dom.development.js:24878:7)
    at commitPassiveMountEffects (react-dom.development.js:24866:3)
    at flushPassiveEffectsImpl (react-dom.development.js:27039:3)
    at flushPassiveEffects (react-dom.development.js:26984:14)
    at react-dom.development.js:26769:9

Also, more points that are really for design, but I wasn't sure from the UI when I'd be muted/unmuted based on voice activity. It also seems a bit odd that it's in 'advanced' and not 'audio'.

@DashieTM
Copy link

DashieTM commented Nov 3, 2022

I will see what causes the error, that ofc shouldn't happen.
Is there anything specific that causes the error? Or just regular use?

As for why it is in an advanced tab. We were asked to do this:
image

@dbkr dbkr deleted the branch matrix-org:robertlong/group-call November 7, 2022 17:24
@dbkr dbkr closed this Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-Enhancement Z-Community-PR Issue is solved by a community member's PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants