Changeset 2210


Ignore:
Timestamp:
Aug 13, 2008 1:53:18 PM (16 years ago)
Author:
bennylp
Message:

Added interactive option in aectest sample and to display WAV duration on exit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/samples/aectest.c

    r2199 r2210  
    5858"  -l  Set the echo tail length in ms. Default is 200 ms            \n" 
    5959"  -r  Set repeat count (default=1)                                 \n" 
    60 "  -a  Algorithm: 0=default, 1=speex, 3=echo suppress               \n"; 
     60"  -a  Algorithm: 0=default, 1=speex, 3=echo suppress               \n" 
     61"  -i  Interactive                                                  \n"; 
    6162 
    6263/*  
     
    9394    unsigned tail_ms = TAIL_LENGTH; 
    9495    pj_timestamp t0, t1; 
    95     int i, repeat=1, c; 
     96    int i, repeat=1, interactive=0, c; 
    9697 
    9798    pj_optind = 0; 
    98     while ((c=pj_getopt(argc, argv, "d:l:a:r:")) !=-1) { 
     99    while ((c=pj_getopt(argc, argv, "d:l:a:r:i")) !=-1) { 
    99100        switch (c) { 
    100101        case 'd': 
     
    131132            } 
    132133            break; 
     134        case 'i': 
     135            interactive = 1; 
     136            break; 
    133137        } 
    134138    } 
     
    247251    pj_get_timestamp(&t1); 
    248252 
     253    i = pjmedia_wav_writer_port_get_pos(wav_out) * 1000 /  
     254        (wav_out->info.clock_rate * wav_out->info.channel_count); 
     255    PJ_LOG(3,(THIS_FILE, "Processed %3d.%03ds audio", 
     256              i / 1000, i % 1000)); 
    249257    PJ_LOG(3,(THIS_FILE, "Completed in %u msec\n", pj_elapsed_msec(&t0, &t1))); 
    250258 
     
    272280    pj_shutdown(); 
    273281 
    274 #if 0 
    275     { 
     282    if (interactive) { 
    276283        char s[10]; 
    277284        puts("ENTER to quit"); 
    278285        fgets(s, sizeof(s), stdin); 
    279286    } 
    280 #endif 
    281287 
    282288    /* Done. */ 
Note: See TracChangeset for help on using the changeset viewer.