YobeSDK  0.2.0
yobe_id_listener.hpp
Go to the documentation of this file.
1 
10 #pragma once
11 
12 #include "sdk_build_defs.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 
44  virtual Status Init(const char* license, const char* init_data_path) = 0;
45 
55  virtual Status Init(const char* license, const char* init_data_path, VoiceTarget voice_target,
56  OutputTarget output_voice_target) = 0;
57 
63  virtual Status Deinit() = 0;
64 
70  virtual Status GetStatus() const = 0;
71 
77  virtual VoiceTarget GetVoiceTarget() const = 0;
78 
84  virtual OutputTarget GetOutputTarget() const = 0;
85 
92  virtual Status SelectUser(std::shared_ptr<BiometricTemplate> voice_print) = 0;
93 
100 
106  virtual void SetBioSensitivity(BiometricSensitivity sensitivity_level) = 0;
107 
115  virtual std::shared_ptr<BiometricTemplate> MergeUserTemplates(
116  const std::vector<std::shared_ptr<BiometricTemplate>>& template_list) const = 0;
117 
131  virtual std::shared_ptr<BiometricTemplate> RegisterTemplate(const double* samples, uint32_t sample_count) const = 0;
132 
141  virtual std::shared_ptr<BiometricTemplate> RegisterTemplate(const std::string& wave_file) const = 0;
142 
156  virtual Status ProcessBuffer(const int16_t* in_samples, std::vector<int16_t>& out_samples,
157  uint32_t in_sample_count) = 0;
158 
162  virtual Status ProcessBuffer(const double* in_samples, std::vector<double>& out_samples,
163  uint32_t in_sample_count) = 0;
164 };
165 } // namespace Yobe
166 
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:56
VoiceTarget
These enums are used to specify whether the target voice is near or far from the microphone.
Definition: yobe_lib_util.hpp:36
BiometricSensitivity
The level of sensitivity to use for biometric template matching.
Definition: yobe_lib_util.hpp:18
OutputTarget
The enumeration is used to define the output target of LATTE algorithm. The output or sink target can...
Definition: yobe_lib_util.hpp:47
The main class for utilizing the Yobe IDListener functionality.
Definition: yobe_id_listener.hpp:27
virtual Status GetStatus() const =0
Retrieves the current status of the IDListener.
virtual std::shared_ptr< BiometricTemplate > RegisterTemplate(const std::string &wave_file) const =0
Creates a BiometricTemplate from a wave file containing speech data.
virtual Status Deinit()=0
Cleans up the internals of the IDListener.
virtual Status ProcessBuffer(const int16_t *in_samples, std::vector< int16_t > &out_samples, uint32_t in_sample_count)=0
ProcessBuffer processes a two-channel interleaved audio buffer and writes the processed audio to out_...
virtual Status ProcessBuffer(const double *in_samples, std::vector< double > &out_samples, uint32_t in_sample_count)=0
ProcessBuffer processes a two-channel interleaved audio buffer and writes the processed audio to out_...
virtual void SetBioSensitivity(BiometricSensitivity sensitivity_level)=0
Set the sensitivity level for biometric template matching.
virtual VoiceTarget GetVoiceTarget() const =0
Retrieves the current voice target status.
virtual OutputTarget GetOutputTarget() const =0
Retrieves the current output voice target status.
virtual Status SelectUser(std::shared_ptr< BiometricTemplate > voice_print)=0
Selects the user based on their biometric template.
virtual BiometricSensitivity GetBioSensitivity() const =0
Retrieves the sensitivity level for biometric template matching.
virtual std::shared_ptr< BiometricTemplate > MergeUserTemplates(const std::vector< std::shared_ptr< BiometricTemplate >> &template_list) const =0
Merge multiple BiometricTemplate containing voice data from the same user into one template.
virtual std::shared_ptr< BiometricTemplate > RegisterTemplate(const double *samples, uint32_t sample_count) const =0
Creates a biometric template from an audio buffer.
virtual Status Init(const char *license, const char *init_data_path, VoiceTarget voice_target, OutputTarget output_voice_target)=0
Initializes the internals of the IDListener with additional options.
virtual Status Init(const char *license, const char *init_data_path)=0
Initializes the internals of the IDListener.