]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
whisper : add missing speaker turn API function for whisper_state (#1330)
authorDidzis Gosko <redacted>
Tue, 3 Oct 2023 19:55:48 +0000 (22:55 +0300)
committerGitHub <redacted>
Tue, 3 Oct 2023 19:55:48 +0000 (22:55 +0300)
whisper.cpp
whisper.h

index f1c3567df7a4d6030a6d893edca7240de5c87919..916883c36e935017c8361d02a626eabbfc6fff88 100644 (file)
@@ -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;
 }
index 73ab4d799a23ad73bf9a6406fd9e503116bb8917..6c0efc15870b18545f53971cc66acbcdbb8e589a 100644 (file)
--- 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);