11 #include <unordered_map>
34 <<
"score: " << obj.
score <<
", "
50 using Ptr = std::shared_ptr<VoiceTemplateMatcher>;
135 using Ptr = std::shared_ptr<VoiceTemplateFactory>;
157 const std::string& audioPath,
173 const float *floatSamples,
191 const int16_t *pcm16Samples,
209 const uint8_t *pcm16Bytes,
222 const std::vector<VerifyFileBatchElement>& input_batch)
const = 0;
Class for creating and merging voice templates.
Definition: verify.h:132
std::shared_ptr< VoiceTemplateFactory > Ptr
Definition: verify.h:135
static Ptr create(const std::string &initPath)
Factory method.
virtual const size_t & getMinimumAudioSampleRate() const =0
Returns minimum supported input audio sampling frequency in Hz.
virtual std::vector< VoiceTemplate::Ptr > createVoiceTemplateBatch(const std::vector< VerifySamplesBatchElement< float >> &input_batch) const =0
Creates a voice template from the given batch of float audio samples.
virtual VoiceTemplate::Ptr createVoiceTemplate(const int16_t *pcm16Samples, size_t numSamples, size_t sampleRate, const ChannelType &channelType=ChannelType::MIC) const =0
Creates a voice template from the given PCM16 audio samples.
virtual VoiceTemplate::Ptr createVoiceTemplate(const float *floatSamples, size_t numSamples, size_t sampleRate, const ChannelType &channelType=ChannelType::MIC) const =0
Creates a voice template from the given float audio samples.
virtual std::vector< VoiceTemplate::Ptr > createVoiceTemplateBatch(const std::vector< VerifyFileBatchElement > &input_batch) const =0
Creates a voice template from the given batch of WAV files.
virtual ~VoiceTemplateFactory()=default
virtual std::vector< VoiceTemplate::Ptr > createVoiceTemplateBatch(const std::vector< VerifySamplesBatchElement< uint8_t >> &input_batch) const =0
Creates a voice template from the given batch of byte representation PCM16 audio samples.
virtual VoiceTemplate::Ptr mergeVoiceTemplates(const std::vector< VoiceTemplate::Ptr > &voiceTemplates) const =0
Merges multiple voice templates of a single speaker to a union voice template.
virtual VoiceTemplate::Ptr createVoiceTemplate(const std::string &audioPath, const ChannelType &channelType=ChannelType::MIC) const =0
Creates a voice template from the given audio file.
virtual const std::string & getInitDataId() const =0
Returns ID of the init data, which was used to create the factory.
virtual std::vector< VoiceTemplate::Ptr > createVoiceTemplateBatch(const std::vector< VerifySamplesBatchElement< int16_t >> &input_batch) const =0
Creates a voice template from the given batch of PCM16 audio samples.
virtual VoiceTemplate::Ptr createVoiceTemplate(const uint8_t *pcm16Bytes, size_t numBytes, size_t sampleRate, const ChannelType &channelType=ChannelType::MIC) const =0
Creates a voice template from the given byte representation of PCM16 audio samples.
Class for matching voice templates one-to-one.
Definition: verify.h:48
virtual const std::string & getInitDataId() const =0
static Ptr create(const std::string &initPath)
Factory method.
virtual VerifyResult matchVoiceTemplates(const VoiceTemplate::Ptr &template1, const VoiceTemplate::Ptr &template2) const =0
Matches two voice templates one-to-one.
virtual ~VoiceTemplateMatcher()=default
std::shared_ptr< VoiceTemplateMatcher > Ptr
Definition: verify.h:50
std::shared_ptr< VoiceTemplate > Ptr
Definition: voice_template.h:27
#define VOICE_SDK_API
Definition: config.h:21
Definition: intervals.h:8
ChannelType
An enumeration for audio source labeling during voice template creation.
Definition: voice_template.h:15
Struct for verify factory batch processing VoiceTemplateFactory::createVoiceTemplateBatch.
Definition: verify.h:81
std::string wav_file_path
path to WAV file
Definition: verify.h:88
ChannelType channel_type
Audio record channel type.
Definition: verify.h:93
Structure representing voice verification result.
Definition: verify.h:17
VerifyResult(float score, float probability)
Definition: verify.h:30
friend std::ostream & operator<<(std::ostream &os, const VerifyResult &obj)
Definition: verify.h:32
float probability
Voice matching probability from 0 to 1, should be used for making a biometrics authentication decisio...
Definition: verify.h:28
bool operator==(const VerifyResult &other) const
Definition: verify.h:39
float score
Raw verification score, intended to be used for evaluation and data-wise calibration.
Definition: verify.h:22
Struct for verify factory batch processing VoiceTemplateFactory::createVoiceTemplateBatch.
Definition: verify.h:101
size_t data_size
Number of audio samples.
Definition: verify.h:113
const T * data
A buffer containing audio samples.
Definition: verify.h:108
ChannelType channel_type
Audio record channel type.
Definition: verify.h:125
size_t sample_rate
Audio sampling rate in Hz.
Definition: verify.h:120
VerifySamplesBatchElement(const T *data, size_t data_size, size_t sample_rate, ChannelType channel_type)
Definition: verify.h:102