Add safe bindings for speaker diarization

This commit is contained in:
Wenqing Zong 2024-03-20 16:30:13 +00:00
parent 586c517c1c
commit 384ddd77a5
2 changed files with 30 additions and 0 deletions

View file

@ -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 {