Changeset 2167:a72f8c925e4b in roaraudio


Ignore:
Timestamp:
07/25/09 21:42:44 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

start transcoding code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roarclients/roarphone.c

    r2166 r2167  
    4343 int antiecho; 
    4444 int samples; 
     45 int transcode; 
    4546} g_conf; 
    4647 
     
    5859        "  --device   DEVICE    - Set the device\n" 
    5960        "  --antiecho AEMODE    - Set the anti echo mode\n" 
     61        "  --transcode          - Use local transcodeing\n" 
    6062        "  --help               - Show this help\n" 
    6163       ); 
     
    177179                                .codec    = ROAR_CODEC_DEFAULT 
    178180                               }; 
     181 struct roar_audio_info dinfo; 
    179182 struct roar_vio_calls dvio, svio; 
    180183 char * driver   = DRIVER; 
     
    219222    return 1; 
    220223   } 
     224  } else if ( strcmp(k, "--transcode") == 0 ) { 
     225   g_conf.transcode = 1; 
    221226  } else if ( strcmp(k, "--help") == 0 ) { 
    222227   usage(); 
     
    231236 g_conf.samples = info.channels * info.rate / TIMEDIV; 
    232237 
    233  if ( roar_cdriver_open(&dvio, driver, device, &info, ROAR_DIR_BIDIR) == -1 ) { 
     238 memcpy(&dinfo, &info, sizeof(dinfo)); 
     239 
     240 if ( g_conf.transcode ) { 
     241  dinfo.bits  = 16; 
     242  dinfo.codec = ROAR_CODEC_DEFAULT; 
     243 
     244  switch (info.codec) { 
     245   case ROAR_CODEC_ALAW: 
     246   case ROAR_CODEC_MULAW: 
     247     info.bits = 8; 
     248    break; 
     249   case ROAR_CODEC_ROAR_CELT: 
     250     info.bits = 16; 
     251    break; 
     252   case ROAR_CODEC_ROAR_SPEEX: 
     253     info.bits = 16; 
     254    break; 
     255  } 
     256 } 
     257 
     258 if ( roar_cdriver_open(&dvio, driver, device, &dinfo, ROAR_DIR_BIDIR) == -1 ) { 
    234259  return 1; 
    235260 } 
Note: See TracChangeset for help on using the changeset viewer.