public class AgoraAudioVadConfigV2
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private float |
activePercent
The percentage of active frames required in startRecognizeCount frames to
enter speaking state.
|
private float |
adaptiveRmsThresholdFactor
default to : 0.67.i.e 2/3
|
private boolean |
enableAdaptiveRmsThreshold
enable adaptive rms threshold, default value is true
|
private float |
inactivePercent
The percentage of inactive frames required in stopRecognizeCount frames to
enter stop speaking state.
|
private int |
preStartRecognizeCount
The number of audio frames to save before entering the start speaking state.
|
private int |
startRecognizeCount
The number of audio frames required to confirm the speaking state.
|
private int |
startRmsThreshold
rms: for rmsThreshold, the higher the value, the more sensitive to voice
activity.
|
private int |
startVoiceProb
voice prob:
The lower the gate threshold, the higher the probability that a frame is
judged as activity,
which allows the start phase to begin earlier.
|
private int |
stopRecognizeCount
The number of audio frames required to confirm the stop speaking state.
|
private int |
stopRmsThreshold
rms: for rmsThreshold, the higher the value, the more sensitive to voice
activity.
|
private int |
stopVoiceProb
voice prob:
The lower the gate threshold, the higher the probability that a frame is
judged as activity,
which allows the start phase to begin earlier.
|
| Constructor and Description |
|---|
AgoraAudioVadConfigV2()
Creates a VAD configuration with default adaptive values.
|
AgoraAudioVadConfigV2(int preStartRecognizeCount,
int startRecognizeCount,
int stopRecognizeCount,
float activePercent,
float inactivePercent,
int startVoiceProb,
int stopVoiceProb,
int startRmsThreshold,
int stopRmsThreshold,
boolean enableAdaptiveRmsThreshold,
float adaptiveRmsThresholdFactor)
Creates a VAD configuration with custom thresholds.
|
| Modifier and Type | Method and Description |
|---|---|
float |
getActivePercent()
Returns the active percentage threshold.
|
float |
getAdaptiveRmsThresholdFactor()
Returns the adaptive RMS threshold factor.
|
float |
getInactivePercent()
Returns the inactive percentage threshold.
|
int |
getPreStartRecognizeCount()
Returns the pre-start recognition frame count.
|
int |
getStartRecognizeCount()
Returns the frames required to enter speaking state.
|
int |
getStartRmsThreshold()
Returns the RMS threshold required to trigger start.
|
int |
getStartVoiceProb()
Returns the voice probability required to trigger start.
|
int |
getStopRecognizeCount()
Returns the frames required to leave speaking state.
|
int |
getStopRmsThreshold()
Returns the RMS threshold required to trigger stop.
|
int |
getStopVoiceProb()
Returns the voice probability required to trigger stop.
|
boolean |
isEnableAdaptiveRmsThreshold()
Returns whether adaptive RMS thresholds are enabled.
|
void |
setActivePercent(float activePercent)
Sets the active percentage threshold.
|
void |
setAdaptiveRmsThresholdFactor(float adaptiveRmsThresholdFactor)
Sets the adaptive RMS threshold factor.
|
void |
setEnableAdaptiveRmsThreshold(boolean enableAdaptiveRmsThreshold)
Enables or disables adaptive RMS thresholds.
|
void |
setInactivePercent(float inactivePercent)
Sets the inactive percentage threshold.
|
void |
setPreStartRecognizeCount(int preStartRecognizeCount)
Sets the pre-start recognition frame count.
|
void |
setStartRecognizeCount(int startRecognizeCount)
Sets the frames required to enter speaking state.
|
void |
setStartRmsThreshold(int startRmsThreshold)
Sets the RMS threshold required to trigger start.
|
void |
setStartVoiceProb(int startVoiceProb)
Sets the voice probability required to trigger start.
|
void |
setStopRecognizeCount(int stopRecognizeCount)
Sets the frames required to leave speaking state.
|
void |
setStopRmsThreshold(int stopRmsThreshold)
Sets the RMS threshold required to trigger stop.
|
void |
setStopVoiceProb(int stopVoiceProb)
Sets the voice probability required to trigger stop.
|
java.lang.String |
toString() |
private int preStartRecognizeCount
private int startRecognizeCount
private int stopRecognizeCount
private float activePercent
private float inactivePercent
private int startVoiceProb
private int stopVoiceProb
private int startRmsThreshold
private int stopRmsThreshold
private boolean enableAdaptiveRmsThreshold
private float adaptiveRmsThresholdFactor
public AgoraAudioVadConfigV2()
public AgoraAudioVadConfigV2(int preStartRecognizeCount,
int startRecognizeCount,
int stopRecognizeCount,
float activePercent,
float inactivePercent,
int startVoiceProb,
int stopVoiceProb,
int startRmsThreshold,
int stopRmsThreshold,
boolean enableAdaptiveRmsThreshold,
float adaptiveRmsThresholdFactor)
preStartRecognizeCount - Frames buffered before speakingstartRecognizeCount - Frames required to enter speaking statestopRecognizeCount - Frames required to leave speaking stateactivePercent - Percentage threshold for active stateinactivePercent - Percentage threshold for inactive statestartVoiceProb - Voice probability to trigger startstopVoiceProb - Voice probability to trigger stopstartRmsThreshold - RMS threshold to trigger startstopRmsThreshold - RMS threshold to trigger stopenableAdaptiveRmsThreshold - Whether adaptive RMS thresholds are enabledadaptiveRmsThresholdFactor - Factor used when adaptive thresholds are
enabledpublic int getPreStartRecognizeCount()
public void setPreStartRecognizeCount(int preStartRecognizeCount)
preStartRecognizeCount - Pre-start recognition countpublic int getStartRecognizeCount()
public void setStartRecognizeCount(int startRecognizeCount)
startRecognizeCount - Start recognition countpublic int getStopRecognizeCount()
public void setStopRecognizeCount(int stopRecognizeCount)
stopRecognizeCount - Stop recognition countpublic float getActivePercent()
public void setActivePercent(float activePercent)
activePercent - Active percentagepublic float getInactivePercent()
public void setInactivePercent(float inactivePercent)
inactivePercent - Inactive percentagepublic int getStartVoiceProb()
public void setStartVoiceProb(int startVoiceProb)
startVoiceProb - Start voice probabilitypublic int getStopVoiceProb()
public void setStopVoiceProb(int stopVoiceProb)
stopVoiceProb - Stop voice probabilitypublic int getStartRmsThreshold()
public void setStartRmsThreshold(int startRmsThreshold)
startRmsThreshold - Start RMS thresholdpublic int getStopRmsThreshold()
public void setStopRmsThreshold(int stopRmsThreshold)
stopRmsThreshold - Stop RMS thresholdpublic boolean isEnableAdaptiveRmsThreshold()
true if adaptive thresholds are enabled; otherwise
falsepublic void setEnableAdaptiveRmsThreshold(boolean enableAdaptiveRmsThreshold)
enableAdaptiveRmsThreshold - true to enable adaptive thresholdspublic float getAdaptiveRmsThresholdFactor()
public void setAdaptiveRmsThresholdFactor(float adaptiveRmsThresholdFactor)
adaptiveRmsThresholdFactor - Adaptive RMS factorpublic java.lang.String toString()
toString in class java.lang.Object