app icon indicating copy to clipboard operation
app copied to clipboard

Avatar grunts breaks speech phoneme recognition

Open tcm390 opened this issue 3 years ago • 8 comments

The issue is caused by that both audioWorker and microphoneWorker are setting the value of this.volume

related: https://github.com/webaverse/app/issues/3645

Result:

https://user-images.githubusercontent.com/60634884/185251426-803f8f20-16d5-4c41-9b26-8f746012d6e0.mp4

tcm390 avatar Aug 17 '22 21:08 tcm390

disable audio worker after grunt end

Can we disable audio worker after the grunt effect is completed?

If volume goes from 1 -> 0 in one frame won't this cause it to get stuck? That's probably an even worse effect than the bug it is fixing.

How about choose which one to emit when it's enabled, not just by chance when it's zero?

tcm390 avatar Aug 18 '22 20:08 tcm390

Can we disable audio worker after the grunt effect is completed? No I don't think that's right, creating/destroying workers is a pretty heavy operation to run on every sound effect...

avaer avatar Aug 19 '22 19:08 avaer

Can we disable audio worker after the grunt effect is completed? No I don't think that's right, creating/destroying workers is a pretty heavy operation to run on every sound effect...

disable audioWorker to set the volume when isGrunting is false

Got it. Is it okay to use isGrunting in avatar.js to decide whether audioWorker is allowed to set volume or not?

tcm390 avatar Aug 19 '22 19:08 tcm390

Got it. Is it okay to use isGrunting in avatar.js to decide whether audioWorker is allowed to set volume or not?

Probably not, because I think multiple grunts can happen at a time. At the very least I think this would need to be a stack number, not a boolean.

And if this is related to manuallySetMouth, shouldn't both be in the same class? Currently it's spread around so the code is confusing to read.

avaer avatar Aug 20 '22 10:08 avaer

And if this is related to manuallySetMouth, shouldn't both be in the same class? Currently it's spread around so the code is confusing to read.

disable audioworker set volume after grunting

Got it. Renamed characterBehavior.manuallySetMouth to characterBehavior.disableAudioWorkerSetVolume. And used characterBehavior.disableAudioWorkerSetVolume to disable audioWorker after emitting grunt.

tcm390 avatar Aug 21 '22 23:08 tcm390

It looks like this is still using the disable name: https://github.com/webaverse/app/pull/3651/files#diff-fcb2093ac11d9b04a179d3dedbef5c0aae4d14b7f71db90e483becca4170b7ccR2041

avaer avatar Aug 28 '22 02:08 avaer

It looks like this is still using the disable name: https://github.com/webaverse/app/pull/3651/files#diff-fcb2093ac11d9b04a179d3dedbef5c0aae4d14b7f71db90e483becca4170b7ccR2041

Sorry Changed it. change disableAudioWorkerSetVolume to enableAudioWorkerSetVolume

tcm390 avatar Aug 28 '22 15:08 tcm390

I have QA it and seems like work fine.

rondoor124 avatar Aug 30 '22 21:08 rondoor124