Changeset 2322:c1ae140b6ddc in roaraudio


Ignore:
Timestamp:
08/06/09 01:29:40 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

delay cuting data off

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roarclients/roarphone.c

    r2321 r2322  
    4646#define AE_SPEEX     2 
    4747#define AE_ROARD     3 
     48 
     49#define DTX_F        25 
    4850 
    4951struct { 
     
    5355 int64_t dtx_threshold; 
    5456} g_conf; 
     57 
     58int dtx_counter = 0; 
    5559 
    5660struct roar_bixcoder transcoder[1]; 
     
    159163 int64_t rms = roar_rms2_1_16(data, samples); 
    160164 
    161  if ( rms < g_conf.dtx_threshold ) 
    162   memset(data, 0, samples*2); 
     165 if ( rms < g_conf.dtx_threshold ) { 
     166  if ( dtx_counter ) { 
     167   dtx_counter--; 
     168  } else { 
     169   memset(data, 0, samples*2); 
     170  } 
     171 } else { 
     172  dtx_counter = DTX_F; 
     173 } 
    163174 
    164175 return 0; 
Note: See TracChangeset for help on using the changeset viewer.