Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

aflibConverter Class Reference

#include <aflibConverter.h>

List of all members.


Detailed Description

Provides sample rate conversion.

This class will perform audio resampling. With the constructor you can choose the type of resampling to be done. Simple linear interpolation can be done by setting linear_interpolation to be TRUE in the constructor. The other two flags are ignored if this is set. If linear_interpolation is FALSE then some form of filtering will be done. IF high_quality is FALSE then a small filter will be performed. If high_quality is TRUE then a large filter (higher quality) will be performed. For both the small and large filters another parameter can be specified, filter_interpolation. With filter_interpolation set then the filter coefficients used for both the small and large filtering will be interpolated as well.

This class was designed to stream audio data. It also expects audio data as 16 bit values. Each time a new stream is started some initialization needs to be done. Thus the function initialize should be called to initialize everything. This initialize function will set the conversion factor as well as a multiplecation factor for volume. The volume only applies to the small and large filter. Since this filter uses a history of the audio data it is possible for it to vary in amplitude. This allows users to scale the data. This class will work on any number of channels. Once everything is specified then resample should be called as many times as is necessary to process all the data. The value inCount will be returned indicating how many inArray samples were actually used to produce the output. This value can be used to indicate where the next block of inArray data should start. The resample function is driven by the outCount value specified. The inArray should contain at least: outCount / factor + extra_samples. extra_samples depends on the type of filtering done. As a rule of thumb 50 should be adequate for any type of filter.

Definition at line 77 of file aflibConverter.h.

Public Member Functions

 aflibConverter (bool high_quality, bool linear_interpolation, bool filter_interpolation)
 ~aflibConverter ()
void initialize (double factor, int channels, double volume=1.0)
int resample (int &inCount, int outCount, short inArray[], short outArray[])


Constructor & Destructor Documentation

aflibConverter::aflibConverter bool  high_quality,
bool  linear_interpolation,
bool  filter_interpolation
 

Definition at line 114 of file aflibConverter.cc.

References aflibConverter().

Referenced by aflibConverter().

aflibConverter::~aflibConverter  ) 
 

Definition at line 131 of file aflibConverter.cc.


Member Function Documentation

void aflibConverter::initialize double  factor,
int  channels,
double  volume = 1.0
 

Definition at line 160 of file aflibConverter.cc.

References IBUFFSIZE, and TRUE.

int aflibConverter::resample int &  inCount,
int  outCount,
short  inArray[],
short  outArray[]
 

Definition at line 196 of file aflibConverter.cc.

References FALSE, LARGE_FILTER_IMPD, LARGE_FILTER_NMULT, LARGE_FILTER_NWING, LARGE_FILTER_SCALE, SMALL_FILTER_IMPD, SMALL_FILTER_NMULT, SMALL_FILTER_NWING, SMALL_FILTER_SCALE, and TRUE.


The documentation for this class was generated from the following files:
Generated on Sat Oct 22 13:17:06 2005 for DarkIce by  doxygen 1.4.4