diff --git a/src/whisper_ctx.rs b/src/whisper_ctx.rs index 330391e..9f7df00 100644 --- a/src/whisper_ctx.rs +++ b/src/whisper_ctx.rs @@ -517,6 +517,20 @@ impl WhisperContext { pub fn token_transcribe(&self) -> WhisperToken { unsafe { whisper_rs_sys::whisper_token_transcribe(self.ctx) } } + + /// Get whether the next segment is predicted as a speaker turn + /// + /// # Arguments + /// * i_segment: Segment index. + /// + /// # Returns + /// bool + /// + /// # C++ equivalent + /// `bool whisper_full_get_segment_speaker_turn_next(struct whisper_context * ctx, int i_segment)` + pub fn full_get_segment_speaker_turn_next(&mut self, i_segment: c_int) -> bool { + unsafe { whisper_rs_sys::whisper_full_get_segment_speaker_turn_next(self.ctx, i_segment) } + } } impl Drop for WhisperContext { diff --git a/src/whisper_state.rs b/src/whisper_state.rs index f336638..b657e8e 100644 --- a/src/whisper_state.rs +++ b/src/whisper_state.rs @@ -544,4 +544,20 @@ impl<'a> WhisperState<'a> { }, ) } + + /// Get whether the next segment is predicted as a speaker turn. + /// + /// # Arguments + /// * i_segment: Segment index. + /// + /// # Returns + /// bool + /// + /// # C++ equivalent + /// `bool whisper_full_get_segment_speaker_turn_next_from_state(struct whisper_state * state, int i_segment)` + pub fn full_get_segment_speaker_turn_next(&mut self, i_segment: c_int) -> bool { + unsafe { + whisper_rs_sys::whisper_full_get_segment_speaker_turn_next_from_state(self.ptr, i_segment) + } + } }