Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output Text To stdout #59

Closed
TKK13909 opened this issue May 14, 2023 · 2 comments
Closed

Output Text To stdout #59

TKK13909 opened this issue May 14, 2023 · 2 comments

Comments

@TKK13909
Copy link

I think it would be very useful to be able to use this program in conjunction with other programs in the command line.

@nicknesh
Copy link

nicknesh commented Jun 7, 2023

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);
}

@abb128
Copy link
Owner

abb128 commented Oct 4, 2023

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 (#72)

@abb128 abb128 closed this as completed Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants