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

newDominantSpeakerValue will be null when dominantSpeaker is always talking #132

Open
simo-an opened this issue Sep 12, 2023 · 0 comments
Open

Comments

@simo-an
Copy link

simo-an commented Sep 12, 2023

at DominantSpeakerIdentification.java

            if (enableSilence && dominantSpeaker != null && newDominantId == dominantSpeaker.id)
            {
                // We're not in a silence period, and none of the non-dominant speakers won the challenge. Check if
                // the current dominant speaker has been silent for the timeout period, and if so switch to "silence"
                // mode.
                long timeSinceNonSilence = now - dominantSpeaker.lastNonSilence;
                if (timeSinceNonSilence > timeoutToSilenceInterval)
                {
                    newDominantId = null;
                }
            }

as above code, we know that you are relying lastNonSilence to judge whether newDominantId is null

        private void evaluateLongSpeechActivityScore(long now)
        {
            longSpeechActivityScore = computeSpeechActivityScore(longs[0], N3, 47);
            if (longSpeechActivityScore > MIN_SPEECH_ACTIVITY_SCORE)
            {
                lastNonSilence = now;
            }
        }

lastNonSilence is updated only at evaluateLongSpeechActivityScore

        synchronized void evaluateSpeechActivityScores(long now)
        {
            if (computeImmediates())
            {
                evaluateImmediateSpeechActivityScore();
                if (computeMediums())
                {
                    evaluateMediumSpeechActivityScore();
                    if (computeLongs())
                    {
                        evaluateLongSpeechActivityScore(now);
                    }
                }
            }
        }

evaluateLongSpeechActivityScore only be called at evaluateSpeechActivityScores


If dominantSpeaker is always talking, the longs would not change. so, evaluateLongSpeechActivityScore won't be called, and lastNonSilence won't be updated.

So, newDominantId maybe set to null and fire fireActiveSpeakerChanged(null);

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

No branches or pull requests

1 participant