sherpa-onnx-node-addon-api
    Preparing search index...

    Class ForcedAligner

    ForcedAligner: given a wave and its transcript, it computes the start/end time of every phone and word.

    Index
    • Create a forced aligner from a model directory and a pronunciation dictionary.

      const aligner = new ForcedAligner(config)

      Async factory calls this with an internal descriptor.

      Parameters

      • configOrInternal: any

      Returns ForcedAligner

    config: any
    handle: any
    • Compute the alignment of one utterance.

      Parameters

      • stream: OfflineStream
      • text: string

        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 ForcedAlignmentResult

      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. An interval has an empty text for a silence gap in the "words" tier.