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

Generation-time options for advanced TTS synthesis. More...

#include <cxx-api.h>

Collaboration diagram for sherpa_onnx::cxx::GenerationConfig:

Public Attributes

float silence_scale = 0.2
float speed = 1.0
int32_t sid = 0
std::vector< float > reference_audio
int32_t reference_sample_rate = 0
std::string reference_text
int32_t num_steps = 5
std::unordered_map< std::string, std::string > extra
std::vector< std::vector< int32_t > > phoneme_codepoints
std::vector< std::vector< std::string > > tokens

Detailed Description

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

Member Data Documentation

◆ extra

std::unordered_map<std::string, std::string> sherpa_onnx::cxx::GenerationConfig::extra

Model-specific extra attributes serialized to JSON internally.

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

◆ num_steps

int32_t sherpa_onnx::cxx::GenerationConfig::num_steps = 5

Number of flow-matching steps when supported.

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

◆ phoneme_codepoints

std::vector<std::vector<int32_t> > sherpa_onnx::cxx::GenerationConfig::phoneme_codepoints

Pre-phonemized input as Unicode codepoints.

Phonemize the text yourself (for instance with piper_phonemize) and pass the resulting codepoints here. When set, it is used in place of the text argument. Leave empty to use text with a lexicon.

Each inner vector is one sentence.

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

◆ reference_audio

std::vector<float> sherpa_onnx::cxx::GenerationConfig::reference_audio

Reference audio samples for zero-shot or voice-cloning models.

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

◆ reference_sample_rate

int32_t sherpa_onnx::cxx::GenerationConfig::reference_sample_rate = 0

Sample rate of reference_audio.

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

◆ reference_text

std::string sherpa_onnx::cxx::GenerationConfig::reference_text

Optional reference text. Not all models require it.

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

◆ sid

int32_t sherpa_onnx::cxx::GenerationConfig::sid = 0

Speaker ID for multi-speaker models.

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

◆ silence_scale

float sherpa_onnx::cxx::GenerationConfig::silence_scale = 0.2

Silence scale between sentences.

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

◆ speed

float sherpa_onnx::cxx::GenerationConfig::speed = 1.0

Speech speed. Used only by some models.

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

◆ tokens

std::vector<std::vector<std::string> > sherpa_onnx::cxx::GenerationConfig::tokens

Pre-tokenized input, e.g. Chinese pinyin like "zhong1".

Each inner vector is one sentence.

Mutually exclusive with phoneme_codepoints: if both are set, a warning is printed and generation fails.

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


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