PCM conversion
[Device driver]


Detailed Description

convert PCM from and to internal format.


Data Structures

struct  liso_convertor_t
 Audio format convertor info. More...


PCM convertor functions

const liso_convertor_tliso_pcmconv_get (int fmt)
 Get convertor info for a given format.

char * liso_pcmconv_desc (const liso_convertor_t *convertor, liso_fmt_desc_t buf, int sampling, int stereo)
 Make a description string.

int liso_pcmconv_get_fmts (void)
 Get supported audio format.


Typedefs

typedef void(* liso_topcm_t )(int *d, const void *s, int n)
 To internal PCM conversion.

typedef void(* liso_tofmt_t )(void *d, const int *s, const int f, int n)
 From internal PCM conversion.

typedef char liso_fmt_desc_t [24]
 Format description string.


Typedef Documentation

typedef void(* liso_topcm_t)(int *d, const void *s, int n)
 

To internal PCM conversion.

These functions convert OSS PCM format to lisodsp internal one. Internaly the PCM format is stereo signed 16 bit machine endian. Each PCM is stored in an int with left channel in the 16 LSB and right channel in the 16 MSB (It implies integer is at least 32 bit wide).

Each function name is composed with:

  • u8/s8/u16/s16 for signed/unsigned 8-bit/16-bit
  • le/be for big-endian/little-endian
  • m/s for mono/stereo

Parameters:
d Destination buffer (one integer by PCM)
s Source buffer
n Number of PCM to convert

typedef void(* liso_tofmt_t)(void *d, const int *s, const int f, int n)
 

From internal PCM conversion.

These functions convert lisodsp internal mixed-PCM to OSS PCM format. Internaly the mixed-PCM format is stereo signed int so each PCM is stored in two integers (left channel comes first). These values have a weight depending in the number of the number voices added so far. Normalization is performed by a factor which must be equal to (2^liso_MIXER_FIX)/#-channel-added.

Each function name is composed with:

  • u8/s8/u16/s16 for signed/unsigned 8-bit/16-bit
  • le/be for big-endian/little-endian
  • m/s for mono/stereo

Parameters:
d Destination buffer (one integer by PCM)
s Source buffer
f Normalization factor (2^14/channels)
n Number of PCM to convert


Function Documentation

const liso_convertor_t* liso_pcmconv_get int  fmt  ) 
 

Get convertor info for a given format.

Parameters:
fmt Linux audio format (AFMT_???).
Returns:
matching convertor
Return values:
0 error

char* liso_pcmconv_desc const liso_convertor_t convertor,
liso_fmt_desc_t  buf,
int  sampling,
int  stereo
 

Make a description string.

Parameters:
convertor Audio format convertor.
buf Destination buffer
sampling Sampling rate in hz.
stereo 0:mono other:stereo
Return values:
buf Always return buf, no error

int liso_pcmconv_get_fmts void   ) 
 

Get supported audio format.

Returns:
ORed value of all support AFMT_???.


lisodsp logo lisodsp developer documentation
version 0.5.0
Generated on June 2004
by doxygen 1.3.7