public class AgoraAudioVadConfig
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private float |
activePercent
active percent, if over this percent, will be recognized as speaking, default
value is 0.6
|
private float |
aggressive
aggressive factor, greater value means more aggressive, default value is 5.0
|
private int |
anaWindowSz
fft-window Size, will be used to calc rms, default value is 768
|
private int |
fftSz
fft-size, only support: 128, 256, 512, 1024, default value is 1024
|
private int |
frqInputAvailableFlag
whether Aed_InputData will contain external freq.
|
private int |
hopSz
fft-Hop Size, will be used to check, default value is 160
|
private float |
inactivePercent
inactive percent, if below this percent, will be recognized as non-speaking,
default value is 0.2
|
private float |
jointThr
joint threshold in dB, default value is 0.0
|
private int |
preStartRecognizeCount
pre start recognize count, buffer size for 10ms 16KHz 16bit 1channel PCM,
default value is 10
|
private float |
rmsThr
rms threshold in dB, default value is -40.0
|
private int |
startRecognizeCount
start recognize count, buffer size for 10ms 16KHz 16bit 1channel PCM, default
value is 10
|
private int |
stopRecognizeCount
stop recognize count, buffer size for 10ms 16KHz 16bit 1channel PCM, default
value is 6
|
private int |
useCVersionAIModule
whether to use the C version of AI submodules, default value is 0
|
private float |
voiceProbThr
voice probability threshold 0.0f ~ 1.0f, default value is 0.8
|
| Constructor and Description |
|---|
AgoraAudioVadConfig()
Creates a configuration with default thresholds and counters.
|
AgoraAudioVadConfig(int fftSz,
int hopSz,
int anaWindowSz,
int frqInputAvailableFlag,
int useCVersionAIModule,
float voiceProbThr,
float rmsThr,
float jointThr,
float aggressive,
int startRecognizeCount,
int stopRecognizeCount,
int preStartRecognizeCount,
float activePercent,
float inactivePercent)
Creates a configuration with custom parameters.
|
| Modifier and Type | Method and Description |
|---|---|
float |
getActivePercent()
Returns the percentage threshold for active detection.
|
float |
getAggressive()
Returns the aggressiveness factor.
|
int |
getAnaWindowSz()
Returns the analysis window size.
|
int |
getFftSz()
Returns the FFT size used by the detector.
|
int |
getFrqInputAvailableFlag()
Returns the flag indicating external frequency input.
|
int |
getHopSz()
Returns the FFT hop size.
|
float |
getInactivePercent()
Returns the percentage threshold for inactivity detection.
|
float |
getJointThr()
Returns the joint threshold in dB.
|
int |
getPreStartRecognizeCount()
Returns the pre-start recognition buffer size.
|
float |
getRmsThr()
Returns the RMS threshold in dB.
|
int |
getStartRecognizeCount()
Returns the frames required to start recognition.
|
int |
getStopRecognizeCount()
Returns the frames required to stop recognition.
|
int |
getUseCVersionAIModule()
Returns the flag for using the C AI modules.
|
float |
getVoiceProbThr()
Returns the voice probability threshold.
|
void |
setActivePercent(float activePercent)
Sets the percentage threshold for active detection.
|
void |
setAggressive(float aggressive)
Sets the aggressiveness factor.
|
void |
setAnaWindowSz(int anaWindowSz)
Sets the analysis window size.
|
void |
setFftSz(int fftSz)
Sets the FFT size used by the detector.
|
void |
setFrqInputAvailableFlag(int frqInputAvailableFlag)
Sets the flag indicating external frequency input.
|
void |
setHopSz(int hopSz)
Sets the FFT hop size.
|
void |
setInactivePercent(float inactivePercent)
Sets the percentage threshold for inactivity detection.
|
void |
setJointThr(float jointThr)
Sets the joint threshold in dB.
|
void |
setPreStartRecognizeCount(int preStartRecognizeCount)
Sets the pre-start recognition buffer size.
|
void |
setRmsThr(float rmsThr)
Sets the RMS threshold in dB.
|
void |
setStartRecognizeCount(int startRecognizeCount)
Sets the frames required to start recognition.
|
void |
setStopRecognizeCount(int stopRecognizeCount)
Sets the frames required to stop recognition.
|
void |
setUseCVersionAIModule(int useCVersionAIModule)
Sets the flag for using the C AI modules.
|
void |
setVoiceProbThr(float voiceProbThr)
Sets the voice probability threshold.
|
java.lang.String |
toString() |
private int fftSz
private int hopSz
private int anaWindowSz
private int frqInputAvailableFlag
private int useCVersionAIModule
private float voiceProbThr
private float rmsThr
private float jointThr
private float aggressive
private int startRecognizeCount
private int stopRecognizeCount
private int preStartRecognizeCount
private float activePercent
private float inactivePercent
public AgoraAudioVadConfig()
public AgoraAudioVadConfig(int fftSz,
int hopSz,
int anaWindowSz,
int frqInputAvailableFlag,
int useCVersionAIModule,
float voiceProbThr,
float rmsThr,
float jointThr,
float aggressive,
int startRecognizeCount,
int stopRecognizeCount,
int preStartRecognizeCount,
float activePercent,
float inactivePercent)
fftSz - FFT window sizehopSz - Hop size for FFTanaWindowSz - Window size used to calculate RMSfrqInputAvailableFlag - Flag indicating external frequency spectra availabilityuseCVersionAIModule - Flag indicating whether to use C AI modulesvoiceProbThr - Voice probability thresholdrmsThr - RMS threshold in dBjointThr - Joint threshold in dBaggressive - Aggressiveness factorstartRecognizeCount - Frames required to enter speaking statestopRecognizeCount - Frames required to leave speaking statepreStartRecognizeCount - Frames buffered before recognizing speakingactivePercent - Percentage threshold to treat as speakinginactivePercent - Percentage threshold to treat as silencepublic int getFftSz()
public void setFftSz(int fftSz)
fftSz - FFT sizepublic int getHopSz()
public void setHopSz(int hopSz)
hopSz - Hop sizepublic int getAnaWindowSz()
public void setAnaWindowSz(int anaWindowSz)
anaWindowSz - Analysis window sizepublic int getFrqInputAvailableFlag()
public void setFrqInputAvailableFlag(int frqInputAvailableFlag)
frqInputAvailableFlag - Frequency input flagpublic int getUseCVersionAIModule()
public void setUseCVersionAIModule(int useCVersionAIModule)
useCVersionAIModule - C AI module flagpublic float getVoiceProbThr()
public void setVoiceProbThr(float voiceProbThr)
voiceProbThr - Voice probability thresholdpublic float getRmsThr()
public void setRmsThr(float rmsThr)
rmsThr - RMS thresholdpublic float getJointThr()
public void setJointThr(float jointThr)
jointThr - Joint thresholdpublic float getAggressive()
public void setAggressive(float aggressive)
aggressive - Aggressiveness factorpublic int getStartRecognizeCount()
public void setStartRecognizeCount(int startRecognizeCount)
startRecognizeCount - Start recognition countpublic int getStopRecognizeCount()
public void setStopRecognizeCount(int stopRecognizeCount)
stopRecognizeCount - Stop recognition countpublic int getPreStartRecognizeCount()
public void setPreStartRecognizeCount(int preStartRecognizeCount)
preStartRecognizeCount - Pre-start recognition countpublic float getActivePercent()
public void setActivePercent(float activePercent)
activePercent - Active percentagepublic float getInactivePercent()
public void setInactivePercent(float inactivePercent)
inactivePercent - Inactive percentagepublic java.lang.String toString()
toString in class java.lang.Object