aflibconverter_8h-source.html

来自「一个共享源码的音频库5(doc 文档)」· HTML 代码 · 共 221 行 · 第 1/2 页

HTML
221
字号
<!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>aflibConverter.h Source File</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> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="globals.html">File Members</a> &nbsp; </center><hr><h1>aflibConverter.h</h1><a href="aflibConverter_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <font class="comment">/*</font>00002 <font class="comment"> * Copyright: (C) 2000 Julius O. Smith</font>00003 <font class="comment"> *</font>00004 <font class="comment"> *   This library is free software; you can redistribute it and/or</font>00005 <font class="comment"> *   modify it under the terms of the GNU Lesser General Public</font>00006 <font class="comment"> *   License as published by the Free Software Foundation; either</font>00007 <font class="comment"> *   version 2.1 of the License, or any later version.</font>00008 <font class="comment"> *</font>00009 <font class="comment"> *   This library is distributed in the hope that it will be useful,</font>00010 <font class="comment"> *   but WITHOUT ANY WARRANTY; without even the implied warranty of</font>00011 <font class="comment"> *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU</font>00012 <font class="comment"> *   Lesser General Public License for more details.</font>00013 <font class="comment"> *</font>00014 <font class="comment"> *   You should have received a copy of the GNU Lesser General Public</font>00015 <font class="comment"> *   License along with this library; if not, write to the Free Software</font>00016 <font class="comment"> *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA</font>00017 <font class="comment"> *</font>00018 <font class="comment"> *   Julius O. Smith  jos@ccrma.stanford.edu</font>00019 <font class="comment"> *</font>00020 <font class="comment"> */</font>00021 <font class="comment">/* This code was modified by Bruce Forsberg (forsberg@tns.net) to make it</font>00022 <font class="comment">   into a C++ class</font>00023 <font class="comment">*/</font>00024 00025 00026 <font class="preprocessor">#ifndef _AFLIBCONVERTER_H_</font>00027 <font class="preprocessor"></font><font class="preprocessor">#define _AFLIBCONVERTER_H_</font>00028 <font class="preprocessor"></font>00029 <font class="preprocessor">#ifdef HAVE_CONFIG_H</font>00030 <font class="preprocessor"></font><font class="preprocessor">#include &lt;config.h&gt;</font>00031 <font class="preprocessor">#endif</font>00032 <font class="preprocessor"></font>00033 <font class="preprocessor">#ifndef MAX</font><a name="l00034"></a><a class="code" href="aflibConverter_8h.html#a0">00034</a> <font class="preprocessor"></font><font class="preprocessor">#define MAX(x,y) ((x)&gt;(y) ?(x):(y))</font>00035 <font class="preprocessor"></font><font class="preprocessor">#endif</font>00036 <font class="preprocessor"></font><font class="preprocessor">#ifndef MIN</font><a name="l00037"></a><a class="code" href="aflibConverter_8h.html#a1">00037</a> <font class="preprocessor"></font><font class="preprocessor">#define MIN(x,y) ((x)&lt;(y) ?(x):(y))</font>00038 <font class="preprocessor"></font><font class="preprocessor">#endif</font>00039 <font class="preprocessor"></font><a name="l00040"></a><a class="code" href="aflibConverter_8h.html#a2">00040</a> <font class="preprocessor">#define MAX_HWORD (32767)</font><a name="l00041"></a><a class="code" href="aflibConverter_8h.html#a3">00041</a> <font class="preprocessor"></font><font class="preprocessor">#define MIN_HWORD (-32768)</font>00042 <font class="preprocessor"></font><a name="l00043"></a><a class="code" href="aflibConverter_8h.html#a4">00043</a> <font class="preprocessor">#define IBUFFSIZE 4096                         </font><font class="comment">/* Input buffer size */</font>00044 00075 <font class="keyword">class </font><a class="code" href="classaflibData.html">aflibData</a>;00076 00077 <font class="keyword">class </font><a class="code" href="classaflibConverter.html">aflibConverter</a> {00078 00079 <font class="keyword">public</font>:00080 00081    <font class="comment">// Available contructors and destructors</font>00082    <a class="code" href="classaflibConverter.html#a0">aflibConverter</a> (00083       <font class="keywordtype">bool</font>  high_quality,00084       <font class="keywordtype">bool</font>  linear_interpolation,00085       <font class="keywordtype">bool</font>  filter_interpolation);00086 00087    <a class="code" href="classaflibConverter.html#a1">~aflibConverter</a>();00088 00089    <font class="keywordtype">void</font>00090    <a class="code" href="classaflibConverter.html#a2">initialize</a>(00091       <font class="keywordtype">double</font> factor,   <font class="comment">/* factor = Sndout/Sndin */</font>00092       <font class="keywordtype">int</font>    channels, <font class="comment">/* number of sound channels */</font>00093       <font class="keywordtype">double</font> volume = 1.0); <font class="comment">/* factor to multiply amplitude */</font>00094 00095    <font class="keywordtype">int</font>00096    <a class="code" href="classaflibConverter.html#a3">resample</a>(           <font class="comment">/* number of output samples returned */</font>00097       <font class="keywordtype">int</font>&amp; inCount,    <font class="comment">/* number of input samples to convert */</font>00098         <font class="keywordtype">int</font> outCount,    <font class="comment">/* number of output samples to compute */</font>00099       <font class="keywordtype">short</font> inArray[], <font class="comment">/* input array data (length inCount * nChans) */</font>00100       <font class="keywordtype">short</font> outArray[]);<font class="comment">/* output array data (length outCount * nChans) */</font>00101  00102  00103 <font class="keyword">private</font>:00104 00105    <a class="code" href="classaflibConverter.html#a0">aflibConverter</a>();00106 00107    <a class="code" href="classaflibConverter.html#a0">aflibConverter</a>(<font class="keyword">const</font> <a class="code" href="classaflibConverter.html">aflibConverter</a>&amp; op);00108 00109    <font class="keyword">const</font> <a class="code" href="classaflibConverter.html">aflibConverter</a>&amp;00110    operator=(<font class="keyword">const</font> <a class="code" href="classaflibConverter.html">aflibConverter</a>&amp; op);00111 00112    <font class="keywordtype">int</font>00113    err_ret(<font class="keywordtype">char</font> *s);00114 00115    <font class="keywordtype">void</font>00116    deleteMemory();00117 00118    <font class="keywordtype">int</font>00119    readData(00120       <font class="keywordtype">int</font>   inCount,       <font class="comment">/* _total_ number of frames in input file */</font>00121       <font class="keywordtype">short</font> inArray[],     <font class="comment">/* input data */</font>00122       <font class="keywordtype">short</font> *outPtr[],     <font class="comment">/* array receiving chan samps */</font>00123       <font class="keywordtype">int</font>   dataArraySize, <font class="comment">/* size of these arrays */</font>00124       <font class="keywordtype">int</font>   Xoff,          <font class="comment">/* read into input array starting at this index */</font>00125       <font class="keywordtype">bool</font>  init_count);00126 00127 00128    <font class="keyword">inline</font> <font class="keywordtype">short</font>00129    WordToHword(<font class="keywordtype">int</font> v, <font class="keywordtype">int</font> scl)00130    {00131        <font class="keywordtype">short</font> out;00132        <font class="keywordtype">int</font> llsb = (1&lt;&lt;(scl-1));00133        v += llsb;          <font class="comment">/* round */</font>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?