Ignore:
Timestamp:
Mar 3, 2010 2:47:35 PM (15 years ago)
Author:
nanang
Message:

Ticket #1042, minor updates related to AEC:

  • Added requirement of AEC minimal latency between reference and echo in aectest sample app.
  • Modified AEC latency in sound port to 3/4 of playback latency.
  • Few cleaned up echo_common.c: unused vars, a bit stricter latency check (to be at least as much as PTIME).
File:
1 edited

Legend:

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

    r2394 r3115  
    5656"\n" 
    5757" options:\n" 
    58 "  -d  The delay between playback and capture in ms. Default is zero.\n" 
     58"  -d  The delay between playback and capture in ms, at least 25 ms.\n" 
     59"      Default is 25 ms. See note below.                            \n" 
    5960"  -l  Set the echo tail length in ms. Default is 200 ms            \n" 
    6061"  -r  Set repeat count (default=1)                                 \n" 
    6162"  -a  Algorithm: 0=default, 1=speex, 3=echo suppress               \n" 
    62 "  -i  Interactive                                                  \n"; 
     63"  -i  Interactive                                                  \n" 
     64"\n" 
     65" Note that for the AEC internal buffering mechanism, it is required\n" 
     66" that the echoed signal (in REC.WAV) is delayed from the           \n" 
     67" corresponding reference signal (in PLAY.WAV) at least as much as  \n" 
     68" frame time + PJMEDIA_WSOLA_DELAY_MSEC. In this application, frame \n" 
     69" time is 20 ms and default PJMEDIA_WSOLA_DELAY_MSEC is 5 ms, hence \n" 
     70" 25 ms delay is the minimum value.                                 \n"; 
    6371 
    6472/*  
     
    92100    pjmedia_frame play_frame, rec_frame; 
    93101    unsigned opt = 0; 
    94     unsigned latency_ms = 0; 
     102    unsigned latency_ms = 25; 
    95103    unsigned tail_ms = TAIL_LENGTH; 
    96104    pj_timestamp t0, t1; 
     
    102110        case 'd': 
    103111            latency_ms = atoi(pj_optarg); 
     112            if (latency_ms < 25) { 
     113                puts("Invalid delay"); 
     114                puts(desc); 
     115            } 
    104116            break; 
    105117        case 'l': 
     
    128140            repeat = atoi(pj_optarg); 
    129141            if (repeat < 1) { 
    130                 puts("Invalid algorithm"); 
     142                puts("Invalid repeat count"); 
    131143                puts(desc); 
    132144                return 1; 
     
    252264    pj_get_timestamp(&t1); 
    253265 
    254     i = pjmedia_wav_writer_port_get_pos(wav_out) * 1000 /  
     266    i = pjmedia_wav_writer_port_get_pos(wav_out) / sizeof(pj_int16_t) * 1000 /  
    255267        (wav_out->info.clock_rate * wav_out->info.channel_count); 
    256268    PJ_LOG(3,(THIS_FILE, "Processed %3d.%03ds audio", 
Note: See TracChangeset for help on using the changeset viewer.