WhisperEngine class final

Transcribes English audio with beam search.

The search matches Hugging Face's generate with num_beams beams and a length penalty of 1, and Whisper's token suppression. fonnx used 2 beams before this, in the ORT BeamSearch graph. Greedy decoding (1 beam) can miss the first sentence when speech starts at 0 s.

Constructors

WhisperEngine(WhisperOnnxBackend _backend, {int beams = 2, int maxNewTokens = 220})

Properties

beams → int
final
hashCode → int
The hash code for this object.
no setterinherited
maxNewTokens → int
The decoder has 448 positions. The prompt uses 4.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() → Future<void>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
transcribe(Float32List samples) → Future<String>
transcribeTokens(Float32List samples) → Future<List<int>>
Returns the text tokens of the best hypothesis.

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

prompt → const List<int>