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

Class for online Opus audio stream processing (voice activity detection and speech statistics computation) More...

#include <voicesdk/media/speech_summary.h>

Public Types

using Ptr = std::shared_ptr< SpeechSummaryStreamOpus >
 

Public Member Functions

virtual void reset ()=0
 Resets stream state: clears buffer, resets speech summary.
 
virtual void finalize ()=0
 Finalizes input audio stream to process remaining audio samples and produce result if it's possible.
 
virtual bool hasSpeechEvents () const =0
 Checks if there are available speech events in output queue. More...
 
virtual SpeechEvent getSpeechEvent ()=0
 Retrieves a single speech event from output FIFO queue. Use hasSpeechEvents() to check if there is available speech event. More...
 
virtual SpeechSummary getTotalSpeechSummary () const =0
 Retrieves total accumulated speech summary. More...
 
virtual SpeechInfo getTotalSpeechInfo () const =0
 Retrieves total accumulated speech info. More...
 
virtual float getCurrentBackgroundLength () const =0
 Method for retrieving current background length (length of a continuous non-speech segment starting on the last detected speech frame) More...
 
virtual void addPacket (const uint8_t *bytes, size_t bytesNum)=0
 Adds Opus packet to process. More...
 
virtual bool compare (const SpeechSummaryStreamOpus::Ptr &other) const =0
 Check if resulting states of this and another stream are equal.
 

Static Public Member Functions

static SpeechSummaryStreamOpus::Ptr create (const std::string &initPath, size_t sampleRate)
 Creates SpeechSummaryStreamOpus instance. More...
 

Detailed Description

Class for online Opus audio stream processing (voice activity detection and speech statistics computation)

Member Function Documentation

◆ addPacket()

virtual void voicesdk::SpeechSummaryStreamOpus::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

◆ create()

static SpeechSummaryStreamOpus::Ptr voicesdk::SpeechSummaryStreamOpus::create ( const std::string &  initPath,
size_t  sampleRate 
)
static

Creates SpeechSummaryStreamOpus instance.

Parameters
initPathInitialization data path
sampleRateAudio sampling rate in Hz
Returns
Smart pointer to created SpeechSummaryStreamOpus instance
Exceptions
std::runtime_errorif runtime error occurred

◆ getCurrentBackgroundLength()

virtual float voicesdk::SpeechSummaryStreamOpus::getCurrentBackgroundLength ( ) const
pure virtual

Method for retrieving current background length (length of a continuous non-speech segment starting on the last detected speech frame)

Returns
current background length in milliseconds

◆ getSpeechEvent()

virtual SpeechEvent voicesdk::SpeechSummaryStreamOpus::getSpeechEvent ( )
pure virtual

Retrieves a single speech event from output FIFO queue. Use hasSpeechEvents() to check if there is available speech event.

Returns
A single speech event
Exceptions
std::runtime_errorif runtime error occurred

◆ getTotalSpeechInfo()

virtual SpeechInfo voicesdk::SpeechSummaryStreamOpus::getTotalSpeechInfo ( ) const
pure virtual

Retrieves total accumulated speech info.

Returns
speech info

◆ getTotalSpeechSummary()

virtual SpeechSummary voicesdk::SpeechSummaryStreamOpus::getTotalSpeechSummary ( ) const
pure virtual

Retrieves total accumulated speech summary.

Returns
speech summary

◆ hasSpeechEvents()

virtual bool voicesdk::SpeechSummaryStreamOpus::hasSpeechEvents ( ) const
pure virtual

Checks if there are available speech events in output queue.

Returns
true if there is available speech event, false otherwise