YobeSDK  0.3.1
Yobe::IDListener Struct Referenceabstract

The main class for utilizing the Yobe IDListener functionality. More...

#include <yobe_id_listener.hpp>

Public Member Functions

 IDListener (const IDListener &)=delete
 
 IDListener (IDListener &&) noexcept=default
 
IDListeneroperator= (const IDListener &)=delete
 
IDListeneroperator= (IDListener &&) noexcept=default
 
virtual Status Init (const char *license, const char *init_data_path, MicOrientation mic_orientation, OutputBufferType output_voice_target)=0
 Initializes the internals of the IDListener with additional options. More...
 
virtual Status Deinit ()=0
 Cleans up the internals of the IDListener. More...
 
virtual Status GetStatus () const =0
 Retrieves the current status of the IDListener. More...
 
virtual MicOrientation GetMicOrientation () const =0
 Retrieves the current microphone orientation. More...
 
virtual VoiceTarget GetVoiceTarget () const =0
 Retrieves the current voice target status. More...
 
virtual OutputBufferType GetOutputBufferType () const =0
 Retrieves the current output buffer type. More...
 
virtual void SetOutputGain (Yobe::OutputGain gain)=0
 Set the output gain for the processed output. More...
 
virtual Yobe::OutputGain GetOutputGain () const =0
 Get the output gain for the processed output. More...
 
virtual Status SelectUser (std::shared_ptr< IDTemplate > voice_print)=0
 Selects the user based on their biometric template. More...
 
virtual IDSensitivity GetIDSensitivity () const =0
 Retrieves the sensitivity level for ID template matching. More...
 
virtual void SetIDSensitivity (IDSensitivity sensitivity_level)=0
 Set the sensitivity level for ID template matching. More...
 
virtual std::shared_ptr< IDTemplateMergeUserTemplates (const std::vector< std::shared_ptr< IDTemplate >> &template_list) const =0
 Merge multiple IDTemplate containing voice data from the same user into one template. More...
 
virtual std::shared_ptr< IDTemplateRegisterTemplate (const double *samples, uint32_t sample_count) const =0
 Creates a ID template from an audio buffer. More...
 
virtual Status ProcessBuffer (const int16_t *in_samples, std::vector< int16_t > &out_samples, uint32_t in_sample_count, bool &is_user_verify)=0
 ProcessBuffer processes a two-channel interleaved audio buffer and writes the processed audio to out_samples. More...
 
virtual Status ProcessBuffer (const double *in_samples, std::vector< double > &out_samples, uint32_t in_sample_count, bool &is_user_verify)=0
 ProcessBuffer processes a two-channel interleaved audio buffer and writes the processed audio to out_samples. More...
 
virtual Yobe::Status StartEnrollment ()=0
 StartEnrollment configures the IDListener for enrolling a new user through registering their voice into a IDTemplate. More...
 
virtual Yobe::Status StopEnrollment ()=0
 StopEnrollment configures the IDListener for normal processing. More...
 

Detailed Description

The main class for utilizing the Yobe IDListener functionality.

The IDListener class provides methods for initializing, deinitializing, and processing voice templates. It also provides methods for changing and retrieving the sensitivity level for ID template matching.

Member Function Documentation

◆ Init()

virtual Status Yobe::IDListener::Init ( const char *  license,
const char *  init_data_path,
MicOrientation  mic_orientation,
OutputBufferType  output_voice_target 
)
pure virtual

Initializes the internals of the IDListener with additional options.

Parameters
[in]licenseThe license provided to you by Yobe.
[in]init_data_pathThe path to data needed to initialize the IDListener.
[in]mic_orientationThis parameter defines the microphones orientation with respect to the target voice.
[in]output_voice_targetIndicates either the ASR output or Muting output. [See Details in doxygen docs]
Returns
The status of the IDListener after initialization.

◆ Deinit()

virtual Status Yobe::IDListener::Deinit ( )
pure virtual

Cleans up the internals of the IDListener.

Returns
The status of the IDListener after deinitialization.

◆ GetStatus()

virtual Status Yobe::IDListener::GetStatus ( ) const
pure virtual

Retrieves the current status of the IDListener.

Returns
The current status of the IDListener.

◆ GetMicOrientation()

virtual MicOrientation Yobe::IDListener::GetMicOrientation ( ) const
pure virtual

Retrieves the current microphone orientation.

Returns
The current MicOrientation.

◆ GetVoiceTarget()

virtual VoiceTarget Yobe::IDListener::GetVoiceTarget ( ) const
pure virtual

Retrieves the current voice target status.

Returns
The current voice target status.

◆ GetOutputBufferType()

virtual OutputBufferType Yobe::IDListener::GetOutputBufferType ( ) const
pure virtual

Retrieves the current output buffer type.

Returns
The current output buffer type. This target is either for Varible or Fixed. Please look at docs for trade offs.

◆ SetOutputGain()

virtual void Yobe::IDListener::SetOutputGain ( Yobe::OutputGain  gain)
pure virtual

Set the output gain for the processed output.

This API provides user ability to setup fixed gain for the processed audio buffer. The default gain set upped by the SDK is MEDIUM.

Returns
None

◆ GetOutputGain()

virtual Yobe::OutputGain Yobe::IDListener::GetOutputGain ( ) const
pure virtual

Get the output gain for the processed output.

This API provides user ability to get gain for the processed audio buffer. The default gain set upped by the SDK is MEDIUM.

Returns
OutputGain

◆ SelectUser()

virtual Status Yobe::IDListener::SelectUser ( std::shared_ptr< IDTemplate voice_print)
pure virtual

Selects the user based on their biometric template.

Parameters
[in]voice_printThe biometric template of the user.
Returns
the status of the IDListener.

◆ GetIDSensitivity()

virtual IDSensitivity Yobe::IDListener::GetIDSensitivity ( ) const
pure virtual

Retrieves the sensitivity level for ID template matching.

Returns
The sensitivity level of ID template matching.

◆ SetIDSensitivity()

virtual void Yobe::IDListener::SetIDSensitivity ( IDSensitivity  sensitivity_level)
pure virtual

Set the sensitivity level for ID template matching.

Parameters
sensitivity_levelThe sensitivity level to be set.

◆ MergeUserTemplates()

virtual std::shared_ptr<IDTemplate> Yobe::IDListener::MergeUserTemplates ( const std::vector< std::shared_ptr< IDTemplate >> &  template_list) const
pure virtual

Merge multiple IDTemplate containing voice data from the same user into one template.

Parameters
[in]template_listA list of voice templates containing voice data from the same user.
Returns
This function returns a single combined template. If there is an error during the merge process, this function will throw an exception or return an error code.

◆ RegisterTemplate()

virtual std::shared_ptr<IDTemplate> Yobe::IDListener::RegisterTemplate ( const double *  samples,
uint32_t  sample_count 
) const
pure virtual

Creates a ID template from an audio buffer.

This function creates a ID template from an audio buffer containing voice data. The resulting template can be used in either the MergeUserTemplates or VerifyTemplate functions to compare the user's voice against a reference template or to merge multiple templates into a single one.

Parameters
[in]samplesPointer to the audio buffer containing the voice data.
[in]sample_countThe number of samples in the audio buffer.
Returns
If successful, this function returns a shared pointer to a new IDTemplate object that can be used in subsequent operations. If there is an error, this function returns a null pointer.

◆ ProcessBuffer() [1/2]

virtual Status Yobe::IDListener::ProcessBuffer ( const int16_t *  in_samples,
std::vector< int16_t > &  out_samples,
uint32_t  in_sample_count,
bool &  is_user_verify 
)
pure virtual

ProcessBuffer processes a two-channel interleaved audio buffer and writes the processed audio to out_samples.

Parameters
[in]in_samplesPointer to the input audio buffer.
[out]out_samplesPointer to a pre-allocated buffer for the processed audio.
[in]in_sample_countNumber of audio samples in the input buffer.
[out]is_user_verifyTrue if the selected user's voice was detected in this buffer.
Returns
The status of the IDListener.
Note
If the buffer size is not correct, the function will return NEEDS_MORE_DATA error code.
In case of any error, the function will return ERR and out_samples will be empty.

◆ ProcessBuffer() [2/2]

virtual Status Yobe::IDListener::ProcessBuffer ( const double *  in_samples,
std::vector< double > &  out_samples,
uint32_t  in_sample_count,
bool &  is_user_verify 
)
pure virtual

ProcessBuffer processes a two-channel interleaved audio buffer and writes the processed audio to out_samples.

Parameters
[in]in_samplesPointer to the input audio buffer.
[out]out_samplesPointer to a pre-allocated buffer for the processed audio.
[in]in_sample_countNumber of audio samples in the input buffer.
[out]is_user_verifyTrue if the selected user's voice was detected in this buffer.
Returns
The status of the IDListener.
Note
If the buffer size is not correct, the function will return NEEDS_MORE_DATA error code.
In case of any error, the function will return ERR and out_samples will be empty.

◆ StartEnrollment()

virtual Yobe::Status Yobe::IDListener::StartEnrollment ( )
pure virtual

StartEnrollment configures the IDListener for enrolling a new user through registering their voice into a IDTemplate.

Once this is called, ProcessBuffer will output buffers that should be directly fed into the RegisterTemplate function to create a new IDTemplate.

◆ StopEnrollment()

virtual Yobe::Status Yobe::IDListener::StopEnrollment ( )
pure virtual

StopEnrollment configures the IDListener for normal processing.

This is usually called after StartEnrollment, once enough data has been given to a IDTemplate for registration.


The documentation for this struct was generated from the following file: