RAII wrapper for a forced aligner.
More...
#include <cxx-api.h>
|
| static ForcedAligner | Create (const ForcedAlignerConfig &config) |
| | Create a forced aligner from a model directory and a pronunciation dictionary.
|
Given a wave and its transcript, it computes the start/end time of every phone and word:
config.
lexicon =
"./english-mfa-v3.1.0/lexicon.txt";
static_cast<int32_t>(wave.samples.size()));
OfflineStream CreateStream() const
Create an utterance stream.
static ForcedAligner Create(const ForcedAlignerConfig &config)
Create a forced aligner from a model directory and a pronunciation dictionary.
ForcedAlignmentResult Compute(const OfflineStream &stream, const std::string &text) const
Compute the alignment of one utterance.
RAII wrapper for an offline decoding stream.
void SetOption(const char *key, const char *value) const
Set a per-stream string option.
void AcceptWaveform(int32_t sample_rate, const float *samples, int32_t n) const
Provide the complete waveform for offline decoding.
Configuration of a forced aligner.
The result of ForcedAligner::Compute().
Definition at line 1042 of file cxx-api.h.
◆ Compute()
- Parameters
-
| stream | A stream created by CreateStream() and filled with a waveform. |
| text | The transcript of the whole utterance. Hanzi text is tokenized per character (multi-character dictionary keys give pronunciation context); anything else is split on whitespace. Punctuation is ignored. |
- Returns
- The alignment result; empty (no tiers, empty textgrid) with a warning on stderr when the stream has no features, every word is out-of-vocabulary, or word boundaries cannot be recovered.
◆ Create()
◆ CreateStream()
| OfflineStream sherpa_onnx::cxx::ForcedAligner::CreateStream |
( |
| ) |
const |
◆ Destroy()
The documentation for this class was generated from the following file: