sherpa-onnx C API 1.0
Public C API and C++ wrapper for sherpa-onnx
Loading...
Searching...
No Matches
sherpa_onnx::cxx::SpeakerEmbeddingManager Class Reference

RAII wrapper for speaker embedding management. More...

#include <cxx-api.h>

+ Inheritance diagram for sherpa_onnx::cxx::SpeakerEmbeddingManager:
+ Collaboration diagram for sherpa_onnx::cxx::SpeakerEmbeddingManager:

Public Member Functions

void Destroy (const SherpaOnnxSpeakerEmbeddingManager *p) const
 Destroy the wrapped C handle.
 
bool Add (const std::string &name, const float *v) const
 Add one enrollment embedding for a speaker.
 
bool AddList (const std::string &name, const float **v) const
 Add multiple enrollment embeddings for one speaker.
 
bool AddListFlattened (const std::string &name, const float *v, int32_t n) const
 Add multiple enrollment embeddings packed in one flat array.
 
bool Remove (const std::string &name) const
 Remove a speaker from the manager.
 
std::string Search (const float *v, float threshold) const
 Search for the best matching enrolled speaker.
 
std::vector< SpeakerMatchGetBestMatches (const float *v, float threshold, int32_t n) const
 Return up to n best matches above a similarity threshold.
 
bool Verify (const std::string &name, const float *v, float threshold) const
 Verify whether a query embedding matches a named speaker.
 
bool Contains (const std::string &name) const
 Check whether a speaker is enrolled.
 
int32_t NumSpeakers () const
 Return the number of enrolled speakers.
 
std::vector< std::string > GetAllSpeakers () const
 Return all enrolled speaker names.
 
- Public Member Functions inherited from sherpa_onnx::cxx::MoveOnly< SpeakerEmbeddingManager, SherpaOnnxSpeakerEmbeddingManager >
 MoveOnly ()=default
 Construct an empty wrapper.
 
 MoveOnly (const SherpaOnnxSpeakerEmbeddingManager *p)
 Construct a wrapper from a raw C handle.
 
 MoveOnly (const MoveOnly &)=delete
 
 MoveOnly (MoveOnly &&other)
 
 ~MoveOnly ()
 Destroy the wrapped handle if present.
 
MoveOnlyoperator= (const MoveOnly &)=delete
 
MoveOnlyoperator= (MoveOnly &&other)
 
const SherpaOnnxSpeakerEmbeddingManagerGet () const
 Return the wrapped raw pointer without transferring ownership.
 
const SherpaOnnxSpeakerEmbeddingManagerRelease ()
 Release ownership of the wrapped raw pointer.
 

Static Public Member Functions

static SpeakerEmbeddingManager Create (int32_t dim)
 Create a speaker embedding manager.
 

Additional Inherited Members

- Protected Attributes inherited from sherpa_onnx::cxx::MoveOnly< SpeakerEmbeddingManager, SherpaOnnxSpeakerEmbeddingManager >
const SherpaOnnxSpeakerEmbeddingManagerp_
 

Detailed Description

Definition at line 1857 of file cxx-api.h.

Member Function Documentation

◆ Add()

bool sherpa_onnx::cxx::SpeakerEmbeddingManager::Add ( const std::string &  name,
const float *  v 
) const

◆ AddList()

bool sherpa_onnx::cxx::SpeakerEmbeddingManager::AddList ( const std::string &  name,
const float **  v 
) const

◆ AddListFlattened()

bool sherpa_onnx::cxx::SpeakerEmbeddingManager::AddListFlattened ( const std::string &  name,
const float *  v,
int32_t  n 
) const

◆ Contains()

bool sherpa_onnx::cxx::SpeakerEmbeddingManager::Contains ( const std::string &  name) const

◆ Create()

static SpeakerEmbeddingManager sherpa_onnx::cxx::SpeakerEmbeddingManager::Create ( int32_t  dim)
static

◆ Destroy()

void sherpa_onnx::cxx::SpeakerEmbeddingManager::Destroy ( const SherpaOnnxSpeakerEmbeddingManager p) const

◆ GetAllSpeakers()

std::vector< std::string > sherpa_onnx::cxx::SpeakerEmbeddingManager::GetAllSpeakers ( ) const

◆ GetBestMatches()

std::vector< SpeakerMatch > sherpa_onnx::cxx::SpeakerEmbeddingManager::GetBestMatches ( const float *  v,
float  threshold,
int32_t  n 
) const

◆ NumSpeakers()

int32_t sherpa_onnx::cxx::SpeakerEmbeddingManager::NumSpeakers ( ) const

◆ Remove()

bool sherpa_onnx::cxx::SpeakerEmbeddingManager::Remove ( const std::string &  name) const

◆ Search()

std::string sherpa_onnx::cxx::SpeakerEmbeddingManager::Search ( const float *  v,
float  threshold 
) const

◆ Verify()

bool sherpa_onnx::cxx::SpeakerEmbeddingManager::Verify ( const std::string &  name,
const float *  v,
float  threshold 
) const

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