Didzis Gosko commited on
Commit
00ca046
·
unverified ·
1 Parent(s): 751235c

whisper : add missing speaker turn API function for whisper_state (#1330)

Browse files
Files changed (2) hide show
  1. whisper.cpp +4 -0
  2. whisper.h +1 -0
whisper.cpp CHANGED
@@ -5270,6 +5270,10 @@ int64_t whisper_full_get_segment_t1(struct whisper_context * ctx, int i_segment)
5270
  return ctx->state->result_all[i_segment].t1;
5271
  }
5272
 
 
 
 
 
5273
  bool whisper_full_get_segment_speaker_turn_next(struct whisper_context * ctx, int i_segment) {
5274
  return ctx->state->result_all[i_segment].speaker_turn_next;
5275
  }
 
5270
  return ctx->state->result_all[i_segment].t1;
5271
  }
5272
 
5273
+ bool whisper_full_get_segment_speaker_turn_next_from_state(struct whisper_state * state, int i_segment) {
5274
+ return state->result_all[i_segment].speaker_turn_next;
5275
+ }
5276
+
5277
  bool whisper_full_get_segment_speaker_turn_next(struct whisper_context * ctx, int i_segment) {
5278
  return ctx->state->result_all[i_segment].speaker_turn_next;
5279
  }
whisper.h CHANGED
@@ -485,6 +485,7 @@ extern "C" {
485
 
486
  // Get whether the next segment is predicted as a speaker turn
487
  WHISPER_API bool whisper_full_get_segment_speaker_turn_next(struct whisper_context * ctx, int i_segment);
 
488
 
489
  // Get the text of the specified segment
490
  WHISPER_API const char * whisper_full_get_segment_text (struct whisper_context * ctx, int i_segment);
 
485
 
486
  // Get whether the next segment is predicted as a speaker turn
487
  WHISPER_API bool whisper_full_get_segment_speaker_turn_next(struct whisper_context * ctx, int i_segment);
488
+ WHISPER_API bool whisper_full_get_segment_speaker_turn_next_from_state(struct whisper_state * state, int i_segment);
489
 
490
  // Get the text of the specified segment
491
  WHISPER_API const char * whisper_full_get_segment_text (struct whisper_context * ctx, int i_segment);