From 403770553116eb91e15a8fd7eb2e1decedab3e1a Mon Sep 17 00:00:00 2001 From: Didzis Gosko Date: Tue, 3 Oct 2023 22:55:48 +0300 Subject: [PATCH] whisper : add missing speaker turn API function for whisper_state (#1330) --- whisper.cpp | 4 ++++ whisper.h | 1 + 2 files changed, 5 insertions(+) diff --git a/whisper.cpp b/whisper.cpp index f1c3567..916883c 100644 --- a/whisper.cpp +++ b/whisper.cpp @@ -5270,6 +5270,10 @@ int64_t whisper_full_get_segment_t1(struct whisper_context * ctx, int i_segment) return ctx->state->result_all[i_segment].t1; } +bool whisper_full_get_segment_speaker_turn_next_from_state(struct whisper_state * state, int i_segment) { + return state->result_all[i_segment].speaker_turn_next; +} + bool whisper_full_get_segment_speaker_turn_next(struct whisper_context * ctx, int i_segment) { return ctx->state->result_all[i_segment].speaker_turn_next; } diff --git a/whisper.h b/whisper.h index 73ab4d7..6c0efc1 100644 --- a/whisper.h +++ b/whisper.h @@ -485,6 +485,7 @@ extern "C" { // Get whether the next segment is predicted as a speaker turn WHISPER_API bool whisper_full_get_segment_speaker_turn_next(struct whisper_context * ctx, int i_segment); + WHISPER_API bool whisper_full_get_segment_speaker_turn_next_from_state(struct whisper_state * state, int i_segment); // Get the text of the specified segment WHISPER_API const char * whisper_full_get_segment_text (struct whisper_context * ctx, int i_segment);