Closed TKK13909 closed 1 year ago
Just change line_generator_set_text
- file line-gen.c line 315.
It will print penultimate line
void line_generator_set_text(struct line_generator *lg, GtkLabel *lbl) {
char *head = &lg->output[0];
*head = '\0';
static char the_last_printed_line[AC_LINE_MAX];
for(int i=AC_LINE_COUNT-1; i>=0; i--) {
struct line *curr = &lg->lines[REL_LINE_IDX(lg->current_line, -i)];
head += sprintf(head, "%s", curr->text);
if(i != 0) head += sprintf(head, "\n");
if( i == 1){ // print the penultimate line
if( strcmp(the_last_printed_line, curr->text) != 0){
printf("%s\n", curr->text);
strcpy(the_last_printed_line, curr->text);
}
}
}
gtk_label_set_markup(lbl, lg->output);
}
There is an example application in https://github.com/abb128/april-asr that allows you to stream audio as stdin and get results in stdout. Since this is a GUI application I don't think it makes sense to add stdout, but I'm adding a DBus API instead (https://github.com/abb128/LiveCaptions/issues/72)
I think it would be very useful to be able to use this program in conjunction with other programs in the command line.