YobeSDK  0.3.0
yobe_id_listener.hpp
Go to the documentation of this file.
1 
10 #pragma once
11 
12 #include "sdk_build_defs.h"
13 #include "yobe_id_template.hpp"
14 #include "yobe_lib_util.hpp"
15 
16 #include <memory>
17 #include <string>
18 #include <vector>
19 
20 namespace Yobe {
27 struct YOBE_SDK_API IDListener {
28  virtual ~IDListener() = default;
29 
30  IDListener() = default;
31  IDListener(const IDListener&) = delete;
32  IDListener(IDListener&&) noexcept = default;
33 
34  IDListener& operator=(const IDListener&) = delete;
35  IDListener& operator=(IDListener&&) noexcept = default;
36 
46  virtual Status Init(const char* license, const char* init_data_path, MicOrientation mic_orientation, OutputBufferType output_voice_target) = 0;
47 
53  virtual Status Deinit() = 0;
54 
60  virtual Status GetStatus() const = 0;
61 
67  virtual MicOrientation GetMicOrientation() const = 0;
68 
74  virtual VoiceTarget GetVoiceTarget() const = 0;
75 
82 
91  virtual void SetOutputGain(Yobe::OutputGain gain) = 0;
92 
101  virtual Yobe::OutputGain GetOutputGain() const = 0;
102 
103 
110  virtual Status SelectUser(std::shared_ptr<IDTemplate> voice_print) = 0;
111 
117  virtual IDSensitivity GetIDSensitivity() const = 0;
118 
124  virtual void SetIDSensitivity(IDSensitivity sensitivity_level) = 0;
125 
133  virtual std::shared_ptr<IDTemplate> MergeUserTemplates(
134  const std::vector<std::shared_ptr<IDTemplate>>& template_list) const = 0;
135 
149  virtual std::shared_ptr<IDTemplate> RegisterTemplate(const double* samples, uint32_t sample_count) const = 0;
150 
165  virtual Status ProcessBuffer(const int16_t* in_samples, std::vector<int16_t>& out_samples,
166  uint32_t in_sample_count, bool& is_user_verify) = 0;
167 
169  virtual Status ProcessBuffer(const double* in_samples, std::vector<double>& out_samples,
170  uint32_t in_sample_count, bool& is_user_verify) = 0;
171 
178 
185 };
186 } // namespace Yobe
187 
Contains all Yobe-related functions and structures.
Definition: yobe_bio_listener.hpp:12
Status
Yobe status codes that give information on internal state.
Definition: yobe_lib_util.hpp:83
OutputGain
This enumeration is used to define the fixed output gain for Yobe's processed buffer....
Definition: yobe_lib_util.hpp:37
OutputBufferType
This is used to define the OutputBufferType of LATTE algorithm. To learn which applies to your applic...
Definition: yobe_lib_util.hpp:74
MicOrientation
This enum allows the algorithm to know how your microphones are oriented. [See Details in doxygen doc...
Definition: yobe_lib_util.hpp:55
VoiceTarget
This is used to specify whether the target voice is near or far from the microphone.
Definition: yobe_lib_util.hpp:64
IDSensitivity
The level of sensitivity to use for ID template matching.
Definition: yobe_lib_util.hpp:18
The main class for utilizing the Yobe IDListener functionality.
Definition: yobe_id_listener.hpp:27
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_...
virtual IDSensitivity GetIDSensitivity() const =0
Retrieves the sensitivity level for ID template matching.
virtual Status GetStatus() const =0
Retrieves the current status of the IDListener.
virtual Yobe::Status StartEnrollment()=0
StartEnrollment configures the IDListener for enrolling a new user through registering their voice in...
virtual std::shared_ptr< IDTemplate > MergeUserTemplates(const std::vector< std::shared_ptr< IDTemplate >> &template_list) const =0
Merge multiple IDTemplate containing voice data from the same user into one template.
virtual Status SelectUser(std::shared_ptr< IDTemplate > voice_print)=0
Selects the user based on their biometric template.
virtual Status Deinit()=0
Cleans up the internals of the IDListener.
virtual MicOrientation GetMicOrientation() const =0
Retrieves the current microphone orientation.
virtual void SetOutputGain(Yobe::OutputGain gain)=0
Set the output gain for the processed output.
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.
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_...
virtual Yobe::Status StopEnrollment()=0
StopEnrollment configures the IDListener for normal processing.
virtual OutputBufferType GetOutputBufferType() const =0
Retrieves the current output buffer type.
virtual VoiceTarget GetVoiceTarget() const =0
Retrieves the current voice target status.
virtual std::shared_ptr< IDTemplate > RegisterTemplate(const double *samples, uint32_t sample_count) const =0
Creates a ID template from an audio buffer.
virtual void SetIDSensitivity(IDSensitivity sensitivity_level)=0
Set the sensitivity level for ID template matching.
virtual Yobe::OutputGain GetOutputGain() const =0
Get the output gain for the processed output.