📄 aflibaudiosampleratecvt.3
字号:
.TH "aflibAudioSampleRateCvt" 3 "8 May 2002" "Open Source Audio Library Project" \" -*- nroff -*-.ad l.nh.SH NAMEaflibAudioSampleRateCvt \- Allows the \fBaflibConverter\fP class to be used in an audio chain. .SH SYNOPSIS.br.PP\fC#include <aflibAudioSampleRateCvt.h>\fP.PPInherits \fBaflibAudio\fP..PPInherited by \fBaflibAudioPitch\fP..PP.SS "Public Methods".in +1c.ti -1c.RI "\fBaflibAudioSampleRateCvt\fP (\fBaflibAudio\fP &audio, double factor, bool linear_interpolation=FALSE, bool high_quality=FALSE, bool filter_interpolation=FALSE)".br.RI "\fIBasic constructor to place object in a chain.\fP".ti -1c.RI "\fB~aflibAudioSampleRateCvt\fP ()".br.RI "\fIDestructor.\fP".ti -1c.RI "void \fBsetFactor\fP (double factor, double volume=1.0)".br.RI "\fISets the sample rate conversion factor.\fP".ti -1c.RI "void \fBsetInputConfig\fP (const \fBaflibConfig\fP &cfg)".br.RI "\fISets the input and output audio data configuration of this object.\fP".ti -1c.RI "const char * \fBgetName\fP () const".br.RI "\fIReturns the name of the derived class.\fP".ti -1c.RI "\fBaflibStatus\fP \fBcompute_segment\fP (list< \fBaflibData\fP * > &data, long long position=-1)".br.RI "\fIPerforms the sample rate conversion of a segment of data.\fP".ti -1c.RI "\fBaflibData\fP * \fBprocess\fP (\fBaflibStatus\fP &ret_status, long long position, int &num_samples, bool free_memory=TRUE)".br.RI "\fIPerforms some needed preprocessing before base class function is called.\fP".ti -1c.RI "bool \fBisDataSizeSupported\fP (\fBaflib_data_size\fP size)".br.RI "\fIInform base class that this object only supports 16bit signed data.\fP".ti -1c.RI "bool \fBisChannelsSupported\fP (int &channels)".br.RI "\fIInform base class that this object only supports 16bit signed data.\fP".in -1c.SH "DETAILED DESCRIPTION".PP Allows the \fBaflibConverter\fP class to be used in an audio chain..PPThis class is a wrapper class around the audio rate converter class (ie \fBaflibConverter\fP). This class provides data to the converter class and keeps the audio data streaming. This is needed for file formats that don't have random access and for reading from devices. This class can use the \fBaflibMemCache\fP base class to perform audio caching. This class will provide sample rate conversion by virtually any factor as well as set the quality of the conversion. .PP.SH "CONSTRUCTOR & DESTRUCTOR DOCUMENTATION".PP .SS "aflibAudioSampleRateCvt::aflibAudioSampleRateCvt (\fBaflibAudio\fP & audio, double factor, bool linear_interpolation = FALSE, bool high_quality = FALSE, bool filter_interpolation = FALSE)".PPBasic constructor to place object in a chain..PPDifferent sampling methods can be employed. By setting linear_interpolation to TRUE you are selecting the fastest and least quality method of sampling. With this set to TRUE the high_quality and filter_interpolation have no effect. This method just does a simple interpolation process when resampling occurs. Thus alias distoration can occur with this mode. To use high quality resampling the linear_interpolation flag should be set to FALSE. With linear_interpolation set to FALSE then the high_quality flag can be set. If it is set to FALSE then a small filter will be used. If TRUE a large filter will be used. The large filter is the best quality and also is the most CPU intensive. For most applications the small filter should be more than adequate. With the small and large filter a third parameter can be set, filter_interpolation. With filter_interpolation set then the filter coefficients used for both the small and large filtering will be interpolated as well. Defaults for the 3 filter parameters are set in the constructor which will create a small filter. This should be sufficient for most cases. For a description of factor see the setFactor member function description. .SS "aflibAudioSampleRateCvt::~aflibAudioSampleRateCvt ()".PPDestructor..PP.SH "MEMBER FUNCTION DOCUMENTATION".PP .SS "\fBaflibStatus\fP aflibAudioSampleRateCvt::compute_segment (list< \fBaflibData\fP * > & data, long long position = -1)\fC [virtual]\fP".PPPerforms the sample rate conversion of a segment of data..PPThis is the function that does all the work. It does many things. It takes an input buffer of data from its parent and adds it to the end of any previously unused data from the previous pass. This is done so that data can be streamed. The new data is sent to the converter. The convertered data is then saved to the output buffer to be returned to the next object. Any unused data is saved for the next pass. NOTE: one can disable the caching in the \fBaflibMemCache\fP base class, which is enabled by default for this class, and instead use a simple caching implemented in this function. .PPReimplemented from \fBaflibAudio\fP..SS "const char* aflibAudioSampleRateCvt::getName () const\fC [inline, virtual]\fP".PPReturns the name of the derived class..PPReimplemented from \fBaflibAudio\fP..PPReimplemented in \fBaflibAudioPitch\fP..SS "bool aflibAudioSampleRateCvt::isChannelsSupported (int & channels)\fC [virtual]\fP".PPInform base class that this object only supports 16bit signed data..PPThis overrides the virtual function in the base class. This algorithm works only on 16 bit signed data. Base class must convert the data. .PPReimplemented from \fBaflibAudio\fP..SS "bool aflibAudioSampleRateCvt::isDataSizeSupported (\fBaflib_data_size\fP size)\fC [virtual]\fP".PPInform base class that this object only supports 16bit signed data..PPThis overrides the virtual function in the base class. This algorithm works only on 16 bit signed data. Base class must convert the data. .PPReimplemented from \fBaflibAudio\fP..SS "\fBaflibData\fP * aflibAudioSampleRateCvt::process (\fBaflibStatus\fP & ret_status, long long position, int & num_samples, bool free_memory = TRUE)\fC [virtual]\fP".PPPerforms some needed preprocessing before base class function is called..PPThis function will take the position and number of samples requested and based on several factors will determine what position and number of samples is required from its parent. It will also try as best as possible to keep the data streaming. This is so it can read from a device or a format that does not have random access. When this function is done it will call the \fBaflibAudio\fP base classes function of the same name. .PPReimplemented from \fBaflibAudio\fP..SS "void aflibAudioSampleRateCvt::setFactor (double factor, double volume = 1.0)".PPSets the sample rate conversion factor..PPThis will set the sample rate conversion factor. Virtually any value, within reason, can be set. For instance to convert 22050 to 44100 a factor of 0.5 should be used. To convert 44100 to 22050 a factor of 2.0 should be used. This will change the factor that was set in the constructor. This function can also be used to change the final amplitude. This only applies to the small and large filters and not the linear mode. .SS "void aflibAudioSampleRateCvt::setInputConfig (const \fBaflibConfig\fP & cfg)\fC [virtual]\fP".PPSets the input and output audio data configuration of this object..PPThis function overrides the \fBaflibAudio\fP base class function. It will change the output rate sample rate in the output audio configuration. .PPReimplemented from \fBaflibAudio\fP..PPReimplemented in \fBaflibAudioPitch\fP..SH "AUTHOR".PP Generated automatically by Doxygen for Open Source Audio Library Project from the source code.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -