@@ -180,10 +180,7 @@ void whisper_print_segment_callback(struct whisper_context * ctx, struct whisper
180
180
t1 = whisper_full_get_segment_t1 (ctx, i);
181
181
}
182
182
183
- if (!params.no_timestamps ) {
184
- Rprintf (" [%s --> %s] " , to_timestamp (t0).c_str (), to_timestamp (t1).c_str ());
185
- }
186
-
183
+
187
184
if (params.diarize && pcmf32s.size () == 2 ) {
188
185
speaker = estimate_diarization_speaker (pcmf32s, t0, t1);
189
186
}
@@ -206,21 +203,18 @@ void whisper_print_segment_callback(struct whisper_context * ctx, struct whisper
206
203
}
207
204
} else {
208
205
const char * text = whisper_full_get_segment_text (ctx, i);
209
-
210
- Rprintf (" %s%s" , speaker.c_str (), text);
206
+ if (!params.no_timestamps ) {
207
+ Rprintf (" [%s --> %s] %s%s\n " , to_timestamp (t0).c_str (), to_timestamp (t1).c_str (), speaker.c_str (), text);
208
+ }else {
209
+ Rprintf (" %s%s\n " , speaker.c_str (), text);
210
+ }
211
211
}
212
212
213
213
if (params.tinydiarize ) {
214
214
if (whisper_full_get_segment_speaker_turn_next (ctx, i)) {
215
215
Rprintf (" %s" , params.tdrz_speaker_turn .c_str ());
216
216
}
217
217
}
218
-
219
- // with timestamps or speakers: each segment on new line
220
- if (!params.no_timestamps || params.diarize ) {
221
- Rprintf (" \n " );
222
- }
223
-
224
218
Rcpp::checkUserInterrupt ();
225
219
}
226
220
}
0 commit comments