getSegmentCallback method
void
getSegmentCallback(
- Pointer<
whisper_context> ctx, - Pointer<
whisper_state> state, - int nNew,
- Pointer<
Void> userData,
Implementation
void getSegmentCallback(Pointer<whisper_context> ctx,
Pointer<whisper_state> state, int nNew, Pointer<Void> userData) {
if (this.ctx == nullptr) {
this.ctx = ctx;
}
int nSegments = WhisperLibrary.binding.whisper_full_n_segments(ctx);
if (lastNSegments != nSegments) {
result.value += output(lastNSegments, nSegments, timeOffset: timeOffset);
lastNSegments = nSegments;
}
}