VoiceSDK  5.0.2
Public Types | Public Member Functions | List of all members
voicesdk::SpeechSummaryStream Class Referenceabstract

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

#include <voicesdk/media/speech_summary.h>

Public Types

using Ptr = std::shared_ptr< SpeechSummaryStream >
 

Public Member Functions

virtual void reset ()=0
 Resets stream state: clears buffer, resets speech summary. More...
 
virtual void finalize ()=0
 Finalizes input audio stream to process remaining audio samples and produce result if it's possible. More...
 
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 addSamples (const uint8_t *bytes, size_t bytesNum)=0
 Adds PCM16 audio samples to process. More...
 
virtual void addSamples (const int16_t *pcm16Samples, size_t samplesNum)=0
 Adds PCM16 audio samples to process. More...
 
virtual void addSamples (const float *floatSamples, size_t samplesNum)=0
 Adds float audio samples (in [-1; 1] range) to process. More...
 
virtual bool compare (const SpeechSummaryStream::Ptr &other) const =0
 Check if resulting states of this and another stream are equal. More...
 
virtual ~SpeechSummaryStream ()=default
 

Detailed Description

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

See also
SpeechSummaryEngine to create a SpeechSummaryStream instance

Member Typedef Documentation

◆ Ptr

Constructor & Destructor Documentation

◆ ~SpeechSummaryStream()

virtual voicesdk::SpeechSummaryStream::~SpeechSummaryStream ( )
virtualdefault

Member Function Documentation

◆ addSamples() [1/3]

virtual void voicesdk::SpeechSummaryStream::addSamples ( const uint8_t *  bytes,
size_t  bytesNum 
)
pure virtual

Adds PCM16 audio samples to process.

Parameters
bytespointer to array with samples
bytesNumsize of array with samples
Exceptions
std::runtime_errorif runtime error occurred

◆ addSamples() [2/3]

virtual void voicesdk::SpeechSummaryStream::addSamples ( const int16_t *  pcm16Samples,
size_t  samplesNum 
)
pure virtual

Adds PCM16 audio samples to process.

Parameters
pcm16Samplespointer to array with samples
samplesNumsize of array with samples
Exceptions
std::runtime_errorif runtime error occurred

◆ addSamples() [3/3]

virtual void voicesdk::SpeechSummaryStream::addSamples ( const float *  floatSamples,
size_t  samplesNum 
)
pure virtual

Adds float audio samples (in [-1; 1] range) to process.

Parameters
floatSamplespointer to array with samples
samplesNumsize of array with samples
Exceptions
std::runtime_errorif runtime error occurred

◆ compare()

virtual bool voicesdk::SpeechSummaryStream::compare ( const SpeechSummaryStream::Ptr other) const
pure virtual

Check if resulting states of this and another stream are equal.

◆ finalize()

virtual void voicesdk::SpeechSummaryStream::finalize ( )
pure virtual

Finalizes input audio stream to process remaining audio samples and produce result if it's possible.

◆ getCurrentBackgroundLength()

virtual float voicesdk::SpeechSummaryStream::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::SpeechSummaryStream::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::SpeechSummaryStream::getTotalSpeechInfo ( ) const
pure virtual

Retrieves total accumulated speech info.

Returns
speech info

◆ getTotalSpeechSummary()

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

Retrieves total accumulated speech summary.

Returns
speech summary

◆ hasSpeechEvents()

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

Checks if there are available speech events in output queue.

Returns
true if there is available speech event, false otherwise

◆ reset()

virtual void voicesdk::SpeechSummaryStream::reset ( )
pure virtual

Resets stream state: clears buffer, resets speech summary.