<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>SphinxBase: include/sphinxbase/cont_ad.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript"> $(document).ready(initResizable); </script> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.7.3 --> <div id="top"> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">SphinxBase <span id="projectnumber">0.6</span></div> </td> </tr> </tbody> </table> </div> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="navrow2" class="tabs2"> <ul class="tablist"> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>Globals</span></a></li> </ul> </div> </div> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> initNavTree('cont__ad_8h.html',''); </script> <div id="doc-content"> <div class="header"> <div class="headertitle"> <h1>include/sphinxbase/cont_ad.h</h1> </div> </div> <div class="contents"> <a href="cont__ad_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* -*- c-basic-offset: 4; indent-tabs-mode: nil -*- */</span> <a name="l00002"></a>00002 <span class="comment">/* ====================================================================</span> <a name="l00003"></a>00003 <span class="comment"> * Copyright (c) 1999-2001 Carnegie Mellon University. All rights</span> <a name="l00004"></a>00004 <span class="comment"> * reserved.</span> <a name="l00005"></a>00005 <span class="comment"> *</span> <a name="l00006"></a>00006 <span class="comment"> * Redistribution and use in source and binary forms, with or without</span> <a name="l00007"></a>00007 <span class="comment"> * modification, are permitted provided that the following conditions</span> <a name="l00008"></a>00008 <span class="comment"> * are met:</span> <a name="l00009"></a>00009 <span class="comment"> *</span> <a name="l00010"></a>00010 <span class="comment"> * 1. Redistributions of source code must retain the above copyright</span> <a name="l00011"></a>00011 <span class="comment"> * notice, this list of conditions and the following disclaimer. </span> <a name="l00012"></a>00012 <span class="comment"> *</span> <a name="l00013"></a>00013 <span class="comment"> * 2. Redistributions in binary form must reproduce the above copyright</span> <a name="l00014"></a>00014 <span class="comment"> * notice, this list of conditions and the following disclaimer in</span> <a name="l00015"></a>00015 <span class="comment"> * the documentation and/or other materials provided with the</span> <a name="l00016"></a>00016 <span class="comment"> * distribution.</span> <a name="l00017"></a>00017 <span class="comment"> *</span> <a name="l00018"></a>00018 <span class="comment"> * This work was supported in part by funding from the Defense Advanced </span> <a name="l00019"></a>00019 <span class="comment"> * Research Projects Agency and the National Science Foundation of the </span> <a name="l00020"></a>00020 <span class="comment"> * United States of America, and the CMU Sphinx Speech Consortium.</span> <a name="l00021"></a>00021 <span class="comment"> *</span> <a name="l00022"></a>00022 <span class="comment"> * THIS SOFTWARE IS PROVIDED BY CARNEGIE MELLON UNIVERSITY ``AS IS'' AND </span> <a name="l00023"></a>00023 <span class="comment"> * ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, </span> <a name="l00024"></a>00024 <span class="comment"> * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR</span> <a name="l00025"></a>00025 <span class="comment"> * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY</span> <a name="l00026"></a>00026 <span class="comment"> * NOR ITS EMPLOYEES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,</span> <a name="l00027"></a>00027 <span class="comment"> * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT </span> <a name="l00028"></a>00028 <span class="comment"> * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, </span> <a name="l00029"></a>00029 <span class="comment"> * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY </span> <a name="l00030"></a>00030 <span class="comment"> * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT </span> <a name="l00031"></a>00031 <span class="comment"> * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE </span> <a name="l00032"></a>00032 <span class="comment"> * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span> <a name="l00033"></a>00033 <span class="comment"> *</span> <a name="l00034"></a>00034 <span class="comment"> * ====================================================================</span> <a name="l00035"></a>00035 <span class="comment"> *</span> <a name="l00036"></a>00036 <span class="comment"> */</span> <a name="l00037"></a>00037 <span class="comment">/*</span> <a name="l00038"></a>00038 <span class="comment"> * cont_ad.h -- Continuous A/D listening and silence filtering module.</span> <a name="l00039"></a>00039 <span class="comment"> * </span> <a name="l00040"></a>00040 <span class="comment"> * **********************************************</span> <a name="l00041"></a>00041 <span class="comment"> * CMU ARPA Speech Project</span> <a name="l00042"></a>00042 <span class="comment"> *</span> <a name="l00043"></a>00043 <span class="comment"> * Copyright (c) 1996 Carnegie Mellon University.</span> <a name="l00044"></a>00044 <span class="comment"> * ALL RIGHTS RESERVED.</span> <a name="l00045"></a>00045 <span class="comment"> * **********************************************</span> <a name="l00046"></a>00046 <span class="comment"> * </span> <a name="l00047"></a>00047 <span class="comment"> * HISTORY</span> <a name="l00048"></a>00048 <span class="comment"> * </span> <a name="l00049"></a>00049 <span class="comment"> * 13-Jul-98 M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon University</span> <a name="l00050"></a>00050 <span class="comment"> * Added spf and adbufsize to cont_ad_t in order to support variable</span> <a name="l00051"></a>00051 <span class="comment"> * frame sizes depending on audio sampling rate.</span> <a name="l00052"></a>00052 <span class="comment"> * </span> <a name="l00053"></a>00053 <span class="comment"> * 30-Jun-98 M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon University</span> <a name="l00054"></a>00054 <span class="comment"> * Added FILE* argument to cont_ad_powhist_dump().</span> <a name="l00055"></a>00055 <span class="comment"> * </span> <a name="l00056"></a>00056 <span class="comment"> * 16-Jan-98 Paul Placeway (pwp@cs.cmu.edu) at Carnegie Mellon University</span> <a name="l00057"></a>00057 <span class="comment"> * Changed to use dB instead of the weird power measure.</span> <a name="l00058"></a>00058 <span class="comment"> * Added most system parameters to cont_ad_t instead of hardwiring</span> <a name="l00059"></a>00059 <span class="comment"> * them in cont_ad.c.</span> <a name="l00060"></a>00060 <span class="comment"> * Added cont_ad_set_params() and cont_ad_get_params().</span> <a name="l00061"></a>00061 <span class="comment"> * </span> <a name="l00062"></a>00062 <span class="comment"> * 28-Jul-96 M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon University</span> <a name="l00063"></a>00063 <span class="comment"> * Added cont_ad_t.siglvl.</span> <a name="l00064"></a>00064 <span class="comment"> * </span> <a name="l00065"></a>00065 <span class="comment"> * 27-Jun-96 M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon University</span> <a name="l00066"></a>00066 <span class="comment"> * Added the option for cont_ad_read to return -1 on EOF.</span> <a name="l00067"></a>00067 <span class="comment"> * </span> <a name="l00068"></a>00068 <span class="comment"> * 21-Jun-96 M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon University</span> <a name="l00069"></a>00069 <span class="comment"> * Added cont_ad_set_thresh().</span> <a name="l00070"></a>00070 <span class="comment"> * </span> <a name="l00071"></a>00071 <span class="comment"> * 20-Jun-96 M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon University</span> <a name="l00072"></a>00072 <span class="comment"> * Separated thresholds for speech and silence.</span> <a name="l00073"></a>00073 <span class="comment"> * </span> <a name="l00074"></a>00074 <span class="comment"> * 17-Jun-96 M K Ravishankar (rkm@cs.cmu.edu) at Carnegie Mellon University</span> <a name="l00075"></a>00075 <span class="comment"> * Created, based loosely on Steve Reed's original implementation.</span> <a name="l00076"></a>00076 <span class="comment"> */</span> <a name="l00077"></a>00077 <a name="l00078"></a>00078 <a name="l00079"></a>00079 <span class="preprocessor">#ifndef _CONT_AD_H_</span> <a name="l00080"></a>00080 <span class="preprocessor"></span><span class="preprocessor">#define _CONT_AD_H_</span> <a name="l00081"></a>00081 <span class="preprocessor"></span> <a name="l00082"></a>00082 <span class="comment">/* Win32/WinCE DLL gunk */</span> <a name="l00083"></a>00083 <span class="preprocessor">#include <sphinxbase/sphinxbase_export.h></span> <a name="l00084"></a>00084 <span class="preprocessor">#include <sphinxbase/prim_type.h></span> <a name="l00085"></a>00085 <span class="preprocessor">#include <sphinxbase/ad.h></span> <a name="l00086"></a>00086 <a name="l00114"></a>00114 <span class="preprocessor">#include <stdio.h></span> <a name="l00115"></a>00115 <a name="l00116"></a>00116 <a name="l00117"></a>00117 <span class="preprocessor">#ifdef __cplusplus</span> <a name="l00118"></a>00118 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> { <a name="l00119"></a>00119 <span class="preprocessor">#endif</span> <a name="l00120"></a>00120 <span class="preprocessor"></span><span class="preprocessor">#if 0</span> <a name="l00121"></a>00121 <span class="preprocessor"></span><span class="comment">/* Fool Emacs. */</span> <a name="l00122"></a>00122 } <a name="l00123"></a>00123 <span class="preprocessor">#endif</span> <a name="l00124"></a>00124 <span class="preprocessor"></span> <a name="l00125"></a>00125 <span class="comment">/* States of continuous listening module */</span> <a name="l00126"></a>00126 <span class="preprocessor">#define CONT_AD_STATE_SIL 0</span> <a name="l00127"></a>00127 <span class="preprocessor"></span><span class="preprocessor">#define CONT_AD_STATE_SPEECH 1</span> <a name="l00128"></a>00128 <span class="preprocessor"></span> <a name="l00129"></a>00129 <a name="l00135"></a><a class="code" href="structspseg__s.html">00135</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structspseg__s.html">spseg_s</a> { <a name="l00136"></a><a class="code" href="structspseg__s.html#a0f62769ff904df2d374b9500a210374f">00136</a> int32 <a class="code" href="structspseg__s.html#a0f62769ff904df2d374b9500a210374f" title="Frame-id in adbuf (see below) of start of this segment.">startfrm</a>; <a name="l00137"></a><a class="code" href="structspseg__s.html#a91271dd1e4a57bfe1c468e216f7dd42f">00137</a> int32 <a class="code" href="structspseg__s.html#a91271dd1e4a57bfe1c468e216f7dd42f" title="Number of frames in segment (may wrap around adbuf)">nfrm</a>; <a name="l00138"></a><a class="code" href="structspseg__s.html#aec01e1c543395710d3510e18f0938b1a">00138</a> <span class="keyword">struct </span><a class="code" href="structspseg__s.html">spseg_s</a> *<a class="code" href="structspseg__s.html#aec01e1c543395710d3510e18f0938b1a" title="Next speech segment (with some intervening silence)">next</a>; <a name="l00139"></a>00139 } <a class="code" href="structspseg__t.html" title="(FOR INTERNAL USE ) Data structure for maintaining speech (non-silence) segments not yet consumed by ...">spseg_t</a>; <a name="l00140"></a>00140 <a name="l00141"></a>00141 <a name="l00151"></a><a class="code" href="structcont__ad__t.html">00151</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ <a name="l00152"></a>00152 <span class="comment">/* Function to be called for obtaining A/D data (see prototype for ad_read in ad.h) */</span> <a name="l00153"></a>00153 int32 (*adfunc)(<a class="code" href="structad__rec__t.html">ad_rec_t</a> *ad, int16 *buf, int32 max); <a name="l00154"></a><a class="code" href="structcont__ad__t.html#aae5b9d977e62424b0cf0e245485b20a0">00154</a> <a class="code" href="structad__rec__t.html">ad_rec_t</a> *ad; <a name="l00156"></a><a class="code" href="structcont__ad__t.html#a7726e8ea1bcca281a39c4b27bbb115e3">00156</a> int32 <a class="code" href="structcont__ad__t.html#a7726e8ea1bcca281a39c4b27bbb115e3" title="Pass all input data through, without filtering silence.">rawmode</a>; <a name="l00158"></a><a class="code" href="structcont__ad__t.html#a719f5c6816cd0da0a31930a2e572b933">00158</a> int16 *<a class="code" href="structcont__ad__t.html#a719f5c6816cd0da0a31930a2e572b933" title="Circular buffer for maintaining A/D data read until consumed.">adbuf</a>; <a name="l00160"></a>00160 <span class="comment">/* **************************************************************************</span> <a name="l00161"></a>00161 <span class="comment"> * state, read_ts, and siglvl are provided for READ-ONLY use by client</span> <a name="l00162"></a>00162 <span class="comment"> * applications, and are updated by calls to cont_ad_read() (see below). All</span> <a name="l00163"></a>00163 <span class="comment"> * other variables should be left alone.</span> <a name="l00164"></a>00164 <span class="comment"> */</span> <a name="l00165"></a><a class="code" href="structcont__ad__t.html#a5d9420ea711733d1eea9b8f29a638fdb">00165</a> int32 state; <a name="l00167"></a><a class="code" href="structcont__ad__t.html#a7b71e87abfcb3ca4ae73af34c86f955e">00167</a> int32 read_ts; <a name="l00171"></a><a class="code" href="structcont__ad__t.html#a478939247e09a8ae142c8996ec17d8c8">00171</a> int32 seglen; <a name="l00175"></a><a class="code" href="structcont__ad__t.html#a5524c052dcd0a3d1a1c3b1fc2134b62e">00175</a> int32 siglvl; <a name="l00178"></a>00178 <span class="comment">/* ************************************************************************ */</span> <a name="l00179"></a>00179 <a name="l00180"></a><a class="code" href="structcont__ad__t.html#a11a4bb48870007b39f8fa46e4b8f111a">00180</a> int32 sps; <a name="l00183"></a><a class="code" href="structcont__ad__t.html#af7b9044b76ed3b86ce74e4e7215ca4c3">00183</a> int32 <a class="code" href="structcont__ad__t.html#af7b9044b76ed3b86ce74e4e7215ca4c3" title="Whether the source ad device has encountered EOF.">eof</a>; <a name="l00185"></a><a class="code" href="structcont__ad__t.html#a55f701abf33b5f68f9ef4cbf95dfaf73">00185</a> int32 <a class="code" href="structcont__ad__t.html#a55f701abf33b5f68f9ef4cbf95dfaf73" title="Samples/frame; audio level is analyzed within frames.">spf</a>; <a name="l00186"></a><a class="code" href="structcont__ad__t.html#a5c6edc6be287f3ae013c59fef90cb4bd">00186</a> int32 <a class="code" href="structcont__ad__t.html#a5c6edc6be287f3ae013c59fef90cb4bd" title="Buffer size (Number of samples)">adbufsize</a>; <a name="l00187"></a><a class="code" href="structcont__ad__t.html#a54e2013d9634ec473aaf79a606fb2e0f">00187</a> int32 <a class="code" href="structcont__ad__t.html#a54e2013d9634ec473aaf79a606fb2e0f" title="For pre-emphasis filter.">prev_sample</a>; <a name="l00188"></a><a class="code" href="structcont__ad__t.html#aa0617a92c549ac916258a54ec2cdc756">00188</a> int32 <a class="code" href="structcont__ad__t.html#aa0617a92c549ac916258a54ec2cdc756" title="Frame number in adbuf with unconsumed A/D data.">headfrm</a>; <a name="l00189"></a><a class="code" href="structcont__ad__t.html#abed5c6e9a2e078b70fc4c30b667612b2">00189</a> int32 <a class="code" href="structcont__ad__t.html#abed5c6e9a2e078b70fc4c30b667612b2" title="Number of complete frames of unconsumed A/D data in adbuf.">n_frm</a>; <a name="l00190"></a><a class="code" href="structcont__ad__t.html#a7ae5362560d9edfa6c16555285487a7a">00190</a> int32 <a class="code" href="structcont__ad__t.html#a7ae5362560d9edfa6c16555285487a7a" title="Number of samples of unconsumed data in adbuf.">n_sample</a>; <a name="l00191"></a><a class="code" href="structcont__ad__t.html#a4ed32427e6a785b571b1346c85481899">00191</a> int32 <a class="code" href="structcont__ad__t.html#a4ed32427e6a785b571b1346c85481899" title="Total number of frames of A/D data read, including consumed ones.">tot_frm</a>; <a name="l00192"></a><a class="code" href="structcont__ad__t.html#af60b0f78f9959a25cf7e7bf4c4aab4d7">00192</a> int32 <a class="code" href="structcont__ad__t.html#af60b0f78f9959a25cf7e7bf4c4aab4d7" title="PWP: what we claim as the &quot;current&quot; noise level.">noise_level</a>; <a name="l00194"></a><a class="code" href="structcont__ad__t.html#a01f61a105019bea12533db84351d07b9">00194</a> int32 *<a class="code" href="structcont__ad__t.html#a01f61a105019bea12533db84351d07b9" title="Histogram of frame power, moving window, decayed.">pow_hist</a>; <a name="l00195"></a><a class="code" href="structcont__ad__t.html#a18f146239c77ff4ca6157261acdf4083">00195</a> <span class="keywordtype">char</span> *<a class="code" href="structcont__ad__t.html#a18f146239c77ff4ca6157261acdf4083" title="Frame power.">frm_pow</a>; <a name="l00197"></a><a class="code" href="structcont__ad__t.html#a9e23379bf649ee06ece20133316253e5">00197</a> int32 <a class="code" href="structcont__ad__t.html#a9e23379bf649ee06ece20133316253e5" title="Do automatic threshold adjustment or not.">auto_thresh</a>; <a name="l00198"></a><a class="code" href="structcont__ad__t.html#a74a6f56fb4cbde7fc789c9b463cf2f8f">00198</a> int32 <a class="code" href="structcont__ad__t.html#a74a6f56fb4cbde7fc789c9b463cf2f8f" title="Max silence power/frame ABOVE noise level.">delta_sil</a>; <a name="l00199"></a><a class="code" href="structcont__ad__t.html#afca0f69a21d9f28c9610fcefc0e7cb10">00199</a> int32 <a class="code" href="structcont__ad__t.html#afca0f69a21d9f28c9610fcefc0e7cb10" title="Min speech power/frame ABOVE noise level.">delta_speech</a>; <a name="l00200"></a><a class="code" href="structcont__ad__t.html#ac301114b24356aef2edccba155e3cf33">00200</a> int32 <a class="code" href="structcont__ad__t.html#ac301114b24356aef2edccba155e3cf33" title="noise lower than this we ignore">min_noise</a>; <a name="l00201"></a><a class="code" href="structcont__ad__t.html#af3b50663565964bb18ebb9f9e0002421">00201</a> int32 <a class="code" href="structcont__ad__t.html#af3b50663565964bb18ebb9f9e0002421" title="noise higher than this signals an error">max_noise</a>; <a name="l00202"></a><a class="code" href="structcont__ad__t.html#a7c61513f48e8fbc9ab6b57db66dad7b9">00202</a> int32 <a class="code" href="structcont__ad__t.html#a7c61513f48e8fbc9ab6b57db66dad7b9" title="how many frames to look at for speech det">winsize</a>; <a name="l00203"></a><a class="code" href="structcont__ad__t.html#a1b0bb7e53a2bf537ed362badddca341b">00203</a> int32 <a class="code" href="structcont__ad__t.html#a1b0bb7e53a2bf537ed362badddca341b" title="start speech on &gt;= these many frames out of winsize, of &gt;= delta_speech">speech_onset</a>; <a name="l00204"></a><a class="code" href="structcont__ad__t.html#a9f5e138f4b79b59bf4daa5603d171165">00204</a> int32 <a class="code" href="structcont__ad__t.html#a9f5e138f4b79b59bf4daa5603d171165" title="end speech on &gt;= these many frames out of winsize, of &lt;= delta_sil">sil_onset</a>; <a name="l00205"></a><a class="code" href="structcont__ad__t.html#a0d42e3ac6c1e5c59c86a40f4cf26a861">00205</a> int32 <a class="code" href="structcont__ad__t.html#a0d42e3ac6c1e5c59c86a40f4cf26a861" title="pad beggining of speech with this many extra frms">leader</a>; <a name="l00206"></a><a class="code" href="structcont__ad__t.html#aa15db1e9fbb0048225521555ab8d9388">00206</a> int32 <a class="code" href="structcont__ad__t.html#aa15db1e9fbb0048225521555ab8d9388" title="pad end of speech with this many extra frms">trailer</a>; <a name="l00208"></a><a class="code" href="structcont__ad__t.html#a0b9333d9acc41b5bfb67f69fc22ca901">00208</a> int32 thresh_speech; <a name="l00210"></a><a class="code" href="structcont__ad__t.html#adbbe28dca87d06a3ca8d2390d08ea83a">00210</a> int32 thresh_sil; <a name="l00212"></a><a class="code" href="structcont__ad__t.html#a2168183b25add085cf3aa29ddab1c8ce">00212</a> int32 <a class="code" href="structcont__ad__t.html#a2168183b25add085cf3aa29ddab1c8ce" title="Number of frames before next update to pow_hist/thresholds.">thresh_update</a>; <a name="l00213"></a><a class="code" href="structcont__ad__t.html#ac22395096037175bf9a0a1f6877e5ec5">00213</a> float32 adapt_rate; <a name="l00217"></a><a class="code" href="structcont__ad__t.html#ae52185e7f7dfe424060c0ff562a8858b">00217</a> int32 tail_state; <a name="l00220"></a><a class="code" href="structcont__ad__t.html#a75bc7d23bfedfd79a2fd1e3ea2188e4c">00220</a> int32 <a class="code" href="structcont__ad__t.html#a75bc7d23bfedfd79a2fd1e3ea2188e4c" title="Where next analysis window begins.">win_startfrm</a>; <a name="l00221"></a><a class="code" href="structcont__ad__t.html#a14ee16922e7287ad4ce8c51c6ddb74fc">00221</a> int32 <a class="code" href="structcont__ad__t.html#a14ee16922e7287ad4ce8c51c6ddb74fc" title="Number of frames currently available from win_startfrm for analysis.">win_validfrm</a>; <a name="l00222"></a><a class="code" href="structcont__ad__t.html#a628e5b444bde5e0eb0dc7fe8731a31a6">00222</a> int32 n_other; <a name="l00224"></a><a class="code" href="structcont__ad__t.html#abffe61140bc2a02ae4222183b3ef6159">00224</a> <a class="code" href="structspseg__t.html" title="(FOR INTERNAL USE ) Data structure for maintaining speech (non-silence) segments not yet consumed by ...">spseg_t</a> *<a class="code" href="structcont__ad__t.html#abffe61140bc2a02ae4222183b3ef6159" title="First of unconsumed speech segments.">spseg_head</a>; <a name="l00225"></a><a class="code" href="structcont__ad__t.html#ac77e8f8bd27cea3b99238d9663455972">00225</a> <a class="code" href="structspseg__t.html" title="(FOR INTERNAL USE ) Data structure for maintaining speech (non-silence) segments not yet consumed by ...">spseg_t</a> *<a class="code" href="structcont__ad__t.html#ac77e8f8bd27cea3b99238d9663455972" title="Last of unconsumed speech segments.">spseg_tail</a>; <a name="l00227"></a><a class="code" href="structcont__ad__t.html#af8cd2a7e0ef0f4e2c825c7812a091f9c">00227</a> FILE *rawfp; <a name="l00231"></a><a class="code" href="structcont__ad__t.html#adbbb6765386309476549beb058a235c5">00231</a> FILE *logfp; <a name="l00236"></a><a class="code" href="structcont__ad__t.html#ac6e6809727ddc78a13674478d5b527db">00236</a> int32 <a class="code" href="structcont__ad__t.html#ac6e6809727ddc78a13674478d5b527db" title="Number of frames of calibration data seen so far.">n_calib_frame</a>; <a name="l00237"></a>00237 } <a class="code" href="structcont__ad__t.html" title="Continuous listening module or object Continuous listening module or object.">cont_ad_t</a>; <a name="l00238"></a>00238 <a name="l00239"></a>00239 <a name="l00255"></a>00255 SPHINXBASE_EXPORT <a name="l00256"></a>00256 <a class="code" href="structcont__ad__t.html" title="Continuous listening module or object Continuous listening module or object.">cont_ad_t</a> *<a class="code" href="cont__ad_8h.html#af28bf56f17d5cfebf4d960ebed44ca64" title="Initialize a continuous listening/silence filtering object.">cont_ad_init</a> (<a class="code" href="structad__rec__t.html">ad_rec_t</a> *ad, <a name="l00257"></a>00257 int32 (*adfunc)(<a class="code" href="structad__rec__t.html">ad_rec_t</a> *ad, int16 *buf, int32 max) <a name="l00261"></a>00261 ); <a name="l00262"></a>00262 <a name="l00269"></a>00269 SPHINXBASE_EXPORT <a name="l00270"></a>00270 <a class="code" href="structcont__ad__t.html" title="Continuous listening module or object Continuous listening module or object.">cont_ad_t</a> *<a class="code" href="cont__ad_8h.html#a1a9bbf961917827f5d03adcd409dda35" title="Initializes a continuous listening object which simply passes data through (!)">cont_ad_init_rawmode</a> (<a class="code" href="structad__rec__t.html">ad_rec_t</a> *ad, <a name="l00271"></a>00271 int32 (*adfunc)(<a class="code" href="structad__rec__t.html">ad_rec_t</a> *ad, int16 *buf, int32 max)); <a name="l00272"></a>00272 <a name="l00273"></a>00273 <a name="l00302"></a>00302 SPHINXBASE_EXPORT <a name="l00303"></a>00303 int32 <a class="code" href="cont__ad_8h.html#ae664132adc514db01a1d5c1209ded4ba" title="Read raw audio data into the silence filter.">cont_ad_read</a> (<a class="code" href="structcont__ad__t.html" title="Continuous listening module or object Continuous listening module or object.">cont_ad_t</a> *r, <a name="l00304"></a>00304 int16 *buf, <a name="l00307"></a>00307 int32 max <a name="l00310"></a>00310 ); <a name="l00311"></a>00311 <a name="l00315"></a>00315 SPHINXBASE_EXPORT <a name="l00316"></a>00316 int32 <a class="code" href="cont__ad_8h.html#a680721acc14ac191bbae3a4940ed357d" title="Get the maximum number of samples which can be passed into cont_ad_read().">cont_ad_buffer_space</a>(<a class="code" href="structcont__ad__t.html" title="Continuous listening module or object Continuous listening module or object.">cont_ad_t</a> *r); <a name="l00317"></a>00317 <a name="l00330"></a>00330 SPHINXBASE_EXPORT <a name="l00331"></a>00331 int32 <a class="code" href="cont__ad_8h.html#a7a1d0eaf8292a4549b00a97163999321" title="Calibrate the silence filter.">cont_ad_calib</a> (<a class="code" href="structcont__ad__t.html" title="Continuous listening module or object Continuous listening module or object.">cont_ad_t</a> *cont <a name="l00332"></a>00332 ); <a name="l00333"></a>00333 <a name="l00345"></a>00345 SPHINXBASE_EXPORT <a name="l00346"></a>00346 int32 <a class="code" href="cont__ad_8h.html#a8a575044cf22d96a5ec8fb20410b0065" title="Calibrate the silence filter without an audio device.">cont_ad_calib_loop</a> (<a class="code" href="structcont__ad__t.html" title="Continuous listening module or object Continuous listening module or object.">cont_ad_t</a> *r, int16 *buf, int32 max); <a name="l00347"></a>00347 <a name="l00359"></a>00359 SPHINXBASE_EXPORT <a name="l00360"></a>00360 int32 <a class="code" href="cont__ad_8h.html#a6a86e16fb673748be753e2a281ce837a" title="Get the number of samples required to calibrate the silence filter.">cont_ad_calib_size</a>(<a class="code" href="structcont__ad__t.html" title="Continuous listening module or object Continuous listening module or object.">cont_ad_t</a> *r); <a name="l00361"></a>00361 <a name="l00374"></a>00374 SPHINXBASE_EXPORT <a name="l00375"></a>00375 int32 <a class="code" href="cont__ad_8h.html#af9a8f9f66bbfd1ce48fe9366fafcc40d" title="Set silence and speech threshold parameters.">cont_ad_set_thresh</a> (<a class="code" href="structcont__ad__t.html" title="Continuous listening module or object Continuous listening module or object.">cont_ad_t</a> *cont, <a name="l00376"></a>00376 int32 sil, <a name="l00377"></a>00377 int32 sp <a name="l00378"></a>00378 ); <a name="l00379"></a>00379 <a name="l00380"></a>00380 <a name="l00388"></a>00388 SPHINXBASE_EXPORT <a name="l00389"></a>00389 int32 <a class="code" href="cont__ad_8h.html#aa402397c575922ea352afe5e66c02a34" title="Set the changable parameters.">cont_ad_set_params</a> (<a class="code" href="structcont__ad__t.html" title="Continuous listening module or object Continuous listening module or object.">cont_ad_t</a> *r, int32 delta_sil, int32 delta_speech, <a name="l00390"></a>00390 int32 min_noise, int32 max_noise, <a name="l00391"></a>00391 int32 winsize, int32 speech_onset, int32 sil_onset, <a name="l00392"></a>00392 int32 leader, int32 trailer, <a name="l00393"></a>00393 float32 adapt_rate); <a name="l00394"></a>00394 <a name="l00402"></a>00402 SPHINXBASE_EXPORT <a name="l00403"></a>00403 int32 <a class="code" href="cont__ad_8h.html#aedd013bc2c6aca14fba02049ed7645d7" title="PWP 1/14/98 -- get the changable params.">cont_ad_get_params</a> (<a class="code" href="structcont__ad__t.html" title="Continuous listening module or object Continuous listening module or object.">cont_ad_t</a> *r, int32 *delta_sil, int32 *delta_speech, <a name="l00404"></a>00404 int32 *min_noise, int32 *max_noise, <a name="l00405"></a>00405 int32 *winsize, int32 *speech_onset, int32 *sil_onset, <a name="l00406"></a>00406 int32 *leader, int32 *trailer, <a name="l00407"></a>00407 float32 *adapt_rate); <a name="l00408"></a>00408 <a name="l00413"></a>00413 SPHINXBASE_EXPORT <a name="l00414"></a>00414 int32 <a class="code" href="cont__ad_8h.html#a12a017ea8a96dc54445e937bb9de24ae" title="Reset, discarding any accumulated speech segments.">cont_ad_reset</a> (<a class="code" href="structcont__ad__t.html" title="Continuous listening module or object Continuous listening module or object.">cont_ad_t</a> *cont); <span class="comment">/* In: Object pointer from cont_ad_init */</span> <a name="l00415"></a>00415 <a name="l00416"></a>00416 <a name="l00420"></a>00420 SPHINXBASE_EXPORT <a name="l00421"></a>00421 int32 <a class="code" href="cont__ad_8h.html#a381c3df971d43a20e8e8b8da43d2872d" title="Close the continuous listening object.">cont_ad_close</a> (<a class="code" href="structcont__ad__t.html" title="Continuous listening module or object Continuous listening module or object.">cont_ad_t</a> *cont); <span class="comment">/* In: Object pointer from cont_ad_init */</span> <a name="l00422"></a>00422 <a name="l00423"></a>00423 <a name="l00427"></a>00427 SPHINXBASE_EXPORT <a name="l00428"></a>00428 <span class="keywordtype">void</span> <a class="code" href="cont__ad_8h.html#a288394cd94a4992bec9d3911cc875767" title="Dump the power histogram.">cont_ad_powhist_dump</a> (FILE *fp, <a class="code" href="structcont__ad__t.html" title="Continuous listening module or object Continuous listening module or object.">cont_ad_t</a> *cont); <a name="l00429"></a>00429 <a name="l00430"></a>00430 <a name="l00435"></a>00435 SPHINXBASE_EXPORT <a name="l00436"></a>00436 int32 <a class="code" href="cont__ad_8h.html#a8f8284f329d1c0e04856ec9d13020dc4" title="Detach the given continuous listening module from the associated audio device.">cont_ad_detach</a> (<a class="code" href="structcont__ad__t.html" title="Continuous listening module or object Continuous listening module or object.">cont_ad_t</a> *c); <a name="l00437"></a>00437 <a name="l00438"></a>00438 <a name="l00444"></a>00444 SPHINXBASE_EXPORT <a name="l00445"></a>00445 int32 <a class="code" href="cont__ad_8h.html#a41e7f8c5925dba26dd51e8f7a3d16404" title="Attach the continuous listening module to the given audio device/function.">cont_ad_attach</a> (<a class="code" href="structcont__ad__t.html" title="Continuous listening module or object Continuous listening module or object.">cont_ad_t</a> *c, <a class="code" href="structad__rec__t.html">ad_rec_t</a> *a, int32 (*func)(<a class="code" href="structad__rec__t.html">ad_rec_t</a> *, int16 *, int32)); <a name="l00446"></a>00446 <a name="l00447"></a>00447 <a name="l00459"></a>00459 SPHINXBASE_EXPORT <a name="l00460"></a>00460 int32 <a class="code" href="cont__ad_8h.html#a662ed7c409479060e3b5ac8eb7bd1865" title="Set a file for dumping raw audio input.">cont_ad_set_rawfp</a> (<a class="code" href="structcont__ad__t.html" title="Continuous listening module or object Continuous listening module or object.">cont_ad_t</a> *c, <span class="comment">/* The cont_ad object being addressed */</span> <a name="l00461"></a>00461 FILE *fp); <span class="comment">/* File to which raw audio data is to</span> <a name="l00462"></a>00462 <span class="comment"> be dumped; NULL to stop dumping. */</span> <a name="l00463"></a>00463 <a name="l00471"></a>00471 SPHINXBASE_EXPORT <a name="l00472"></a>00472 int32 <a class="code" href="cont__ad_8h.html#a16c5810eb19ed89522ef4c3394bbfe83" title="Set the file to which cont_ad logs its progress.">cont_ad_set_logfp</a> (<a class="code" href="structcont__ad__t.html" title="Continuous listening module or object Continuous listening module or object.">cont_ad_t</a> *c, <span class="comment">/* The cont_ad object being addressed */</span> <a name="l00473"></a>00473 FILE *fp); <span class="comment">/* File to which logs are written;</span> <a name="l00474"></a>00474 <span class="comment"> NULL to stop logging. */</span> <a name="l00475"></a>00475 <a name="l00484"></a>00484 SPHINXBASE_EXPORT <a name="l00485"></a>00485 int32 <a class="code" href="cont__ad_8h.html#a382fe6375eae57a532c524d68bc3dd24" title="Set the silence and speech thresholds.">cont_set_thresh</a>(<a class="code" href="structcont__ad__t.html" title="Continuous listening module or object Continuous listening module or object.">cont_ad_t</a> *r, int32 silence, int32 speech); <a name="l00486"></a>00486 <a name="l00487"></a>00487 <span class="preprocessor">#ifdef __cplusplus</span> <a name="l00488"></a>00488 <span class="preprocessor"></span>} <a name="l00489"></a>00489 <span class="preprocessor">#endif</span> <a name="l00490"></a>00490 <span class="preprocessor"></span> <a name="l00491"></a>00491 <a name="l00492"></a>00492 <span class="preprocessor">#endif</span> </pre></div></div> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="cont__ad_8h.html">cont_ad.h</a> </li> <li class="footer">Generated on Tue Apr 19 2011 for SphinxBase by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.3 </li> </ul> </div> </body> </html>