classaflibaudiosampleratecvt.html
来自「一个共享源码的音频库5(doc 文档)」· HTML 代码 · 共 417 行 · 第 1/2 页
HTML
417 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>aflibAudioSampleRateCvt class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.2.15 --><center><a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center><hr><h1>aflibAudioSampleRateCvt Class Reference</h1>Allows the <a class="el" href="classaflibConverter.html">aflibConverter</a> class to be used in an audio chain. <a href="#_details">More...</a><p><code>#include <<a class="el" href="aflibAudioSampleRateCvt_8h-source.html">aflibAudioSampleRateCvt.h</a>></code><p><p>Inheritance diagram for aflibAudioSampleRateCvt:<p><center><img src="classaflibAudioSampleRateCvt.png" usemap="#aflibAudioSampleRateCvt_map" border="0"></center><map name="aflibAudioSampleRateCvt_map"><area href="classaflibAudio.html" alt="aflibAudio" shape="rect" coords="82,56,236,80"><area href="classaflibChain.html" alt="aflibChain" shape="rect" coords="0,0,154,24"><area href="classaflibMemCache.html" alt="aflibMemCache" shape="rect" coords="164,0,318,24"><area href="classaflibAudioPitch.html" alt="aflibAudioPitch" shape="rect" coords="82,168,236,192"></map><a href="classaflibAudioSampleRateCvt-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0><tr><td colspan=2><br><h2>Public Methods</h2></td></tr><tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classaflibAudioSampleRateCvt.html#a0">aflibAudioSampleRateCvt</a> (<a class="el" href="classaflibAudio.html">aflibAudio</a> &audio, double factor, bool linear_interpolation=FALSE, bool high_quality=FALSE, bool filter_interpolation=FALSE)</td></tr><tr><td> </td><td><font size=-1><em>Basic constructor to place object in a chain.</em> <a href="#a0">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classaflibAudioSampleRateCvt.html#a1">~aflibAudioSampleRateCvt</a> ()</td></tr><tr><td> </td><td><font size=-1><em>Destructor.</em> <a href="#a1">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classaflibAudioSampleRateCvt.html#a2">setFactor</a> (double factor, double volume=1.0)</td></tr><tr><td> </td><td><font size=-1><em>Sets the sample rate conversion factor.</em> <a href="#a2">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classaflibAudioSampleRateCvt.html#a3">setInputConfig</a> (const <a class="el" href="classaflibConfig.html">aflibConfig</a> &cfg)</td></tr><tr><td> </td><td><font size=-1><em>Sets the input and output audio data configuration of this object.</em> <a href="#a3">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>const char * </td><td valign=bottom><a class="el" href="classaflibAudioSampleRateCvt.html#a4">getName</a> () const</td></tr><tr><td> </td><td><font size=-1><em>Returns the name of the derived class.</em> <a href="#a4">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top><a class="el" href="aflib_8h.html#a33">aflibStatus</a> </td><td valign=bottom><a class="el" href="classaflibAudioSampleRateCvt.html#a5">compute_segment</a> (list< <a class="el" href="classaflibData.html">aflibData</a> * > &data, long long position=-1)</td></tr><tr><td> </td><td><font size=-1><em>Performs the sample rate conversion of a segment of data.</em> <a href="#a5">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top><a class="el" href="classaflibData.html">aflibData</a> * </td><td valign=bottom><a class="el" href="classaflibAudioSampleRateCvt.html#a6">process</a> (<a class="el" href="aflib_8h.html#a33">aflibStatus</a> &ret_status, long long position, int &num_samples, bool free_memory=TRUE)</td></tr><tr><td> </td><td><font size=-1><em>Performs some needed preprocessing before base class function is called.</em> <a href="#a6">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classaflibAudioSampleRateCvt.html#a7">isDataSizeSupported</a> (<a class="el" href="aflib_8h.html#a30">aflib_data_size</a> size)</td></tr><tr><td> </td><td><font size=-1><em>Inform base class that this object only supports 16bit signed data.</em> <a href="#a7">More...</a><em></em></font><br><br></td></tr><tr><td nowrap align=right valign=top>bool </td><td valign=bottom><a class="el" href="classaflibAudioSampleRateCvt.html#a8">isChannelsSupported</a> (int &channels)</td></tr><tr><td> </td><td><font size=-1><em>Inform base class that this object only supports 16bit signed data.</em> <a href="#a8">More...</a><em></em></font><br><br></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>Allows the <a class="el" href="classaflibConverter.html">aflibConverter</a> class to be used in an audio chain.<p>This class is a wrapper class around the audio rate converter class (ie <a class="el" href="classaflibConverter.html">aflibConverter</a>). 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 <a class="el" href="classaflibMemCache.html">aflibMemCache</a> 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. <p><hr><h2>Constructor & Destructor Documentation</h2><a name="a0" doxytag="aflibAudioSampleRateCvt::aflibAudioSampleRateCvt"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> aflibAudioSampleRateCvt::aflibAudioSampleRateCvt </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="classaflibAudio.html">aflibAudio</a> & </td> <td class="mdname" nowrap> <em>audio</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>double </td> <td class="mdname" nowrap> <em>factor</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>bool </td> <td class="mdname" nowrap> <em>linear_interpolation</em> = FALSE, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>bool </td> <td class="mdname" nowrap> <em>high_quality</em> = FALSE, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>bool </td> <td class="mdname" nowrap> <em>filter_interpolation</em> = FALSE</td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Basic constructor to place object in a chain.<p>Different 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. </td> </tr></table><a name="a1" doxytag="aflibAudioSampleRateCvt::~aflibAudioSampleRateCvt"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> aflibAudioSampleRateCvt::~aflibAudioSampleRateCvt </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Destructor.<p> </td> </tr></table><hr><h2>Member Function Documentation</h2><a name="a5" doxytag="aflibAudioSampleRateCvt::compute_segment"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="aflib_8h.html#a33">aflibStatus</a> aflibAudioSampleRateCvt::compute_segment </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">list< <a class="el" href="classaflibData.html">aflibData</a> * > & </td> <td class="mdname" nowrap> <em>data</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>long long </td> <td class="mdname" nowrap> <em>position</em> = -1</td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"><code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Performs the sample rate conversion of a segment of data.<p>This 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 <a class="el" href="classaflibMemCache.html">aflibMemCache</a> base class, which is enabled by default for this class, and instead use a simple caching implemented in this function. <p>Reimplemented from <a class="el" href="classaflibAudio.html#a12">aflibAudio</a>. </td> </tr></table><a name="a4" doxytag="aflibAudioSampleRateCvt::getName"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> const char* aflibAudioSampleRateCvt::getName </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> const<code> [inline, virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Returns the name of the derived class.<p><p>Reimplemented from <a class="el" href="classaflibAudio.html#a11">aflibAudio</a>.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?