Call Center SDK  1.11.3
Public Types | Public Member Functions | Static Public Member Functions | List of all members
voicesdk::SpeechEndpointDetectorOpus Class Referenceabstract

Speech endpoint detector class (interface), intended to detect speech end in the Opus audio stream. More...

#include <voicesdk/media/speech.h>

Public Types

using Ptr = std::shared_ptr< SpeechEndpointDetectorOpus >
 

Public Member Functions

virtual void reset ()=0
 Resets detector state.
 
virtual void addPacket (const uint8_t *bytes, size_t bytesNum)=0
 Adds Opus packet to process. More...
 
virtual bool isSpeechEnded ()=0
 Returns detection state. More...
 

Static Public Member Functions

static SpeechEndpointDetectorOpus::Ptr create (size_t minSpeechLengthMs, size_t maxSilenceLengthMs, size_t sampleRate)
 Factory method for creating SpeechEndpointDetectorOpus instance. More...
 

Detailed Description

Speech endpoint detector class (interface), intended to detect speech end in the Opus audio stream.

Member Function Documentation

◆ addPacket()

virtual void voicesdk::SpeechEndpointDetectorOpus::addPacket ( const uint8_t *  bytes,
size_t  bytesNum 
)
pure virtual

Adds Opus packet to process.

Parameters
bytesA buffer containing single Opus packet. It is expected that packet contains data for single mono stream
bytesNumNumber of bytes
Exceptions
std::runtime_errorif runtime error occurred
voicesdk::LicenseExceptionif license error occurred

◆ create()

static SpeechEndpointDetectorOpus::Ptr voicesdk::SpeechEndpointDetectorOpus::create ( size_t  minSpeechLengthMs,
size_t  maxSilenceLengthMs,
size_t  sampleRate 
)
static

Factory method for creating SpeechEndpointDetectorOpus instance.

Parameters
minSpeechLengthMsminimum speech length required to begin speech end detection (ms)
maxSilenceLengthMssilence after speech threshold used to determine if speech is already ended (ms)
sampleRateinput signal sampling rate
Returns
smart pointer to SpeechEndpointDetectorOpus instance
Exceptions
std::runtime_errorif runtime error occurred
voicesdk::LicenseExceptionif license error occurred

◆ isSpeechEnded()

virtual bool voicesdk::SpeechEndpointDetectorOpus::isSpeechEnded ( )
pure virtual

Returns detection state.

Returns
true if speech end was detected, false otherwise