new SpeechEndpointDetector(minSpeechLengthMs, maxSilenceLengthMs, sampleRate)
SpeechEndpointDetector constructor
Parameters:
Name | Type | Description |
---|---|---|
minSpeechLengthMs |
number | Minimum speech length required to begin speech end detection (ms) |
maxSilenceLengthMs |
number | Silence after speech threshold used to determine if speech is already ended (ms) |
sampleRate |
number | Input signal sampling rate |
Methods
addFloatSamples(floatSamples)
Adds float audio samples to process
Parameters:
Name | Type | Description |
---|---|---|
floatSamples |
Float32Array | Array containing float samples |
addPcm16Bytes(bytes)
Adds PCM16 bytes to process
Parameters:
Name | Type | Description |
---|---|---|
bytes |
Uint8Array | Array containing PCM16 bytes |
addPcm16Samples(pcm16Samples)
Adds PCM16 audio samples to process
Parameters:
Name | Type | Description |
---|---|---|
pcm16Samples |
Int16Array | Array containing PCM16 samples |
clone() → {SpeechEndpointDetector}
Returns a new handle for this object to optimize memory consumption
The object will be disposed only after delete() is called for original object and for each of clones
Returns:
New handle of this object
delete()
Manually signals that the object is no more needed. Strongly recommended to call this method explicitly.
isDeleted() → {boolean}
Whether delete method was called (and the object can't be used) or not
Returns:
Whether delete method was called (and the object can't be used) or not
- Type
- boolean
isSpeechEnded() → {boolean}
Returns detection state
Returns:
true if speech end was detected, false otherwise
- Type
- boolean
reset()
Resets detector state