|
sherpa-onnx C API 1.0
Public C API and C++ wrapper for sherpa-onnx
|
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< SpeakerMatch > | GetBestMatches (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. | |
| MoveOnly & | operator= (const MoveOnly &)=delete |
| MoveOnly & | operator= (MoveOnly &&other) |
| const SherpaOnnxSpeakerEmbeddingManager * | Get () const |
| Return the wrapped raw pointer without transferring ownership. | |
| const SherpaOnnxSpeakerEmbeddingManager * | Release () |
| 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 SherpaOnnxSpeakerEmbeddingManager * | p_ |
| bool sherpa_onnx::cxx::SpeakerEmbeddingManager::Add | ( | const std::string & | name, |
| const float * | v | ||
| ) | const |
| bool sherpa_onnx::cxx::SpeakerEmbeddingManager::AddList | ( | const std::string & | name, |
| const float ** | v | ||
| ) | const |
| bool sherpa_onnx::cxx::SpeakerEmbeddingManager::AddListFlattened | ( | const std::string & | name, |
| const float * | v, | ||
| int32_t | n | ||
| ) | const |
| bool sherpa_onnx::cxx::SpeakerEmbeddingManager::Contains | ( | const std::string & | name | ) | const |
|
static |
| void sherpa_onnx::cxx::SpeakerEmbeddingManager::Destroy | ( | const SherpaOnnxSpeakerEmbeddingManager * | p | ) | const |
| std::vector< std::string > sherpa_onnx::cxx::SpeakerEmbeddingManager::GetAllSpeakers | ( | ) | const |
| std::vector< SpeakerMatch > sherpa_onnx::cxx::SpeakerEmbeddingManager::GetBestMatches | ( | const float * | v, |
| float | threshold, | ||
| int32_t | n | ||
| ) | const |
| int32_t sherpa_onnx::cxx::SpeakerEmbeddingManager::NumSpeakers | ( | ) | const |
| bool sherpa_onnx::cxx::SpeakerEmbeddingManager::Remove | ( | const std::string & | name | ) | const |
| std::string sherpa_onnx::cxx::SpeakerEmbeddingManager::Search | ( | const float * | v, |
| float | threshold | ||
| ) | const |
| bool sherpa_onnx::cxx::SpeakerEmbeddingManager::Verify | ( | const std::string & | name, |
| const float * | v, | ||
| float | threshold | ||
| ) | const |