Changeset 960:618277a7056e in roaraudio for roard/driver_ao.c


Ignore:
Timestamp:
12/08/08 21:58:59 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added some codec check. We _assume_ we need to send signed data to all sub drivers in case of bits > 8, in case bits == 8 we just don't know. added warnings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • roard/driver_ao.c

    r958 r960  
    4444 int driver; 
    4545 
     46 ROAR_WARN("The libao driver is obsolete, use another!"); 
     47 
    4648 if ( fh != -1 ) 
    4749  return -1; 
     
    6264 format.channels    = info->channels; 
    6365 format.rate        = info->rate; 
    64  format.byte_format = AO_FMT_NATIVE; 
     66 
     67 if ( info->bits == 8 ) { 
     68  ROAR_WARN("This is the libao driver in 8 bit mode, It's not known to me if I need to provide data in signed or in unsigned mode. If your musik sounds strange try -oO codec=pcm_s_le or -oO codec=pcm_u_le"); 
     69/* NOTE: the following is only true for EsounD driver, not for OSS driver, don't know for the others 
     70  switch (info->codec) { 
     71   case ROAR_CODEC_PCM_U_LE: 
     72   case ROAR_CODEC_PCM_U_BE: 
     73   case ROAR_CODEC_PCM_U_PDP: 
     74     format.byte_format = AO_FMT_NATIVE; 
     75    break; 
     76   default: 
     77     ROAR_ERR("Can not open audio device via libao: codec not supported. You may want to try -oO codec=pcm_u_le or -oO codec=pcm,bits=16"); 
     78     driver_ao_uninit(); 
     79     return -1; 
     80    break; 
     81  } 
     82*/ 
     83 } 
     84 
     85 switch (info->codec) { 
     86  case ROAR_CODEC_PCM_S_LE: 
     87    format.byte_format = AO_FMT_LITTLE; 
     88   break; 
     89  case ROAR_CODEC_PCM_S_BE: 
     90    format.byte_format = AO_FMT_BIG; 
     91   break; 
     92  default: 
     93   ROAR_ERR("Can not open audio device via libao: codec not supported. You may want to try -oO codec=pcm"); 
     94   driver_ao_uninit(); 
     95   return -1; 
     96  break; 
     97 } 
    6598 
    6699 aodevice = ao_open_live(driver, &format, NULL /* no options */); 
Note: See TracChangeset for help on using the changeset viewer.