ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

Audio::LinearRateConverter< stereo, reverseStereo > Class Template Reference

Audio rate converter based on simple linear Interpolation. More...

Inheritance diagram for Audio::LinearRateConverter< stereo, reverseStereo >:
Collaboration diagram for Audio::LinearRateConverter< stereo, reverseStereo >:

List of all members.

Public Member Functions

 LinearRateConverter (st_rate_t inrate, st_rate_t outrate)
int flow (AudioStream &input, st_sample_t *obuf, st_size_t osamp, st_volume_t vol_l, st_volume_t vol_r)
int drain (st_sample_t *obuf, st_size_t osamp, st_volume_t vol)
 LinearRateConverter (st_rate_t inrate, st_rate_t outrate)
int flow (AudioStream &input, st_sample_t *obuf, st_size_t osamp, st_volume_t vol_l, st_volume_t vol_r)
int drain (st_sample_t *obuf, st_size_t osamp, st_volume_t vol)

Protected Attributes

st_sample_t inBuf [INTERMEDIATE_BUFFER_SIZE]
const st_sample_tinPtr
int inLen
frac_t opos
 fractional position of the output stream in input stream unit
frac_t opos_inc
 fractional position increment in the output stream
st_sample_t ilast0
 last sample(s) in the input stream (left/right channel)
st_sample_t ilast1
st_sample_t icur0
 current sample(s) in the input stream (left/right channel)
st_sample_t icur1
LinearRateDetails lr

Detailed Description

template<bool stereo, bool reverseStereo>
class Audio::LinearRateConverter< stereo, reverseStereo >

Audio rate converter based on simple linear Interpolation.

The use of fractional increment allows us to use no buffer. It avoid the problems at the end of the buffer we had with the old method which stored a possibly big buffer of size lcm(in_rate,out_rate).

Limited to sampling frequency <= 65535 Hz.

Definition at line 169 of file rate.cpp.


Constructor & Destructor Documentation

template<bool stereo, bool reverseStereo>
Audio::LinearRateConverter< stereo, reverseStereo >::LinearRateConverter ( st_rate_t  inrate,
st_rate_t  outrate 
)

Definition at line 199 of file rate.cpp.

template<bool stereo, bool reverseStereo>
Audio::LinearRateConverter< stereo, reverseStereo >::LinearRateConverter ( st_rate_t  inrate,
st_rate_t  outrate 
)

Member Function Documentation

template<bool stereo, bool reverseStereo>
int Audio::LinearRateConverter< stereo, reverseStereo >::drain ( st_sample_t obuf,
st_size_t  osamp,
st_volume_t  vol 
) [inline, virtual]

Implements Audio::RateConverter.

Definition at line 189 of file rate.cpp.

template<bool stereo, bool reverseStereo>
int Audio::LinearRateConverter< stereo, reverseStereo >::drain ( st_sample_t obuf,
st_size_t  osamp,
st_volume_t  vol 
) [inline, virtual]

Implements Audio::RateConverter.

Definition at line 283 of file rate_arm.cpp.

template<bool stereo, bool reverseStereo>
int Audio::LinearRateConverter< stereo, reverseStereo >::flow ( AudioStream input,
st_sample_t obuf,
st_size_t  osamp,
st_volume_t  vol_l,
st_volume_t  vol_r 
) [virtual]
Returns:
Number of sample pairs written into the buffer.

Implements Audio::RateConverter.

template<bool stereo, bool reverseStereo>
int Audio::LinearRateConverter< stereo, reverseStereo >::flow ( AudioStream input,
st_sample_t obuf,
st_size_t  osamp,
st_volume_t  vol_l,
st_volume_t  vol_r 
) [virtual]
Returns:
Number of sample pairs written into the buffer.

Implements Audio::RateConverter.

Definition at line 224 of file rate.cpp.


Member Data Documentation

template<bool stereo, bool reverseStereo>
st_sample_t Audio::LinearRateConverter< stereo, reverseStereo >::icur0 [protected]

current sample(s) in the input stream (left/right channel)

Definition at line 184 of file rate.cpp.

template<bool stereo, bool reverseStereo>
st_sample_t Audio::LinearRateConverter< stereo, reverseStereo >::icur1 [protected]

Definition at line 184 of file rate.cpp.

template<bool stereo, bool reverseStereo>
st_sample_t Audio::LinearRateConverter< stereo, reverseStereo >::ilast0 [protected]

last sample(s) in the input stream (left/right channel)

Definition at line 182 of file rate.cpp.

template<bool stereo, bool reverseStereo>
st_sample_t Audio::LinearRateConverter< stereo, reverseStereo >::ilast1 [protected]

Definition at line 182 of file rate.cpp.

template<bool stereo, bool reverseStereo>
st_sample_t Audio::LinearRateConverter< stereo, reverseStereo >::inBuf[INTERMEDIATE_BUFFER_SIZE] [protected]

Definition at line 171 of file rate.cpp.

template<bool stereo, bool reverseStereo>
int Audio::LinearRateConverter< stereo, reverseStereo >::inLen [protected]

Definition at line 173 of file rate.cpp.

template<bool stereo, bool reverseStereo>
const st_sample_t* Audio::LinearRateConverter< stereo, reverseStereo >::inPtr [protected]

Definition at line 172 of file rate.cpp.

template<bool stereo, bool reverseStereo>
LinearRateDetails Audio::LinearRateConverter< stereo, reverseStereo >::lr [protected]

Definition at line 278 of file rate_arm.cpp.

template<bool stereo, bool reverseStereo>
frac_t Audio::LinearRateConverter< stereo, reverseStereo >::opos [protected]

fractional position of the output stream in input stream unit

Definition at line 176 of file rate.cpp.

template<bool stereo, bool reverseStereo>
frac_t Audio::LinearRateConverter< stereo, reverseStereo >::opos_inc [protected]

fractional position increment in the output stream

Definition at line 179 of file rate.cpp.


The documentation for this class was generated from the following files:


Generated on Sat Nov 9 2019 05:01:51 for ResidualVM by doxygen 1.7.1
curved edge   curved edge