\section{cont\+\_\+ad\+\_\+t Struct Reference}
\label{structcont__ad__t}\index{cont\+\_\+ad\+\_\+t@{cont\+\_\+ad\+\_\+t}}


Continuous listening module or object Continuous listening module or object.  




{\ttfamily \#include $<$cont\+\_\+ad.\+h$>$}

\subsection*{Data Fields}
\begin{DoxyCompactItemize}
\item 
\mbox{\label{structcont__ad__t_a1ea446b1fcd417bca75fd4ff5442a256}} 
int32($\ast$ {\bfseries adfunc} )(\textbf{ ad\+\_\+rec\+\_\+t} $\ast$\textbf{ ad}, int16 $\ast$buf, int32 max)
\item 
\textbf{ ad\+\_\+rec\+\_\+t} $\ast$ \textbf{ ad}
\begin{DoxyCompactList}\small\item\em A/D device argument for adfunc. \end{DoxyCompactList}\item 
\mbox{\label{structcont__ad__t_a7726e8ea1bcca281a39c4b27bbb115e3}} 
int32 \textbf{ rawmode}
\begin{DoxyCompactList}\small\item\em Pass all input data through, without filtering silence. \end{DoxyCompactList}\item 
\mbox{\label{structcont__ad__t_a719f5c6816cd0da0a31930a2e572b933}} 
int16 $\ast$ \textbf{ adbuf}
\begin{DoxyCompactList}\small\item\em Circular buffer for maintaining A/D data read until consumed. \end{DoxyCompactList}\item 
int32 \textbf{ state}
\begin{DoxyCompactList}\small\item\em State of data returned by most recent cont\+\_\+ad\+\_\+read call; C\+O\+N\+T\+\_\+\+A\+D\+\_\+\+S\+T\+A\+T\+E\+\_\+\+S\+IL or C\+O\+N\+T\+\_\+\+A\+D\+\_\+\+S\+T\+A\+T\+E\+\_\+\+S\+P\+E\+E\+CH. \end{DoxyCompactList}\item 
int32 \textbf{ read\+\_\+ts}
\begin{DoxyCompactList}\small\item\em Absolute timestamp (total no. \end{DoxyCompactList}\item 
int32 \textbf{ seglen}
\begin{DoxyCompactList}\small\item\em Total no. \end{DoxyCompactList}\item 
int32 \textbf{ siglvl}
\begin{DoxyCompactList}\small\item\em Max signal level for the data consumed by the most recent cont\+\_\+ad\+\_\+read call (dB range\+: 0-\/99). \end{DoxyCompactList}\item 
int32 \textbf{ sps}
\begin{DoxyCompactList}\small\item\em Samples/sec; moved from ad-\/$>$sps to break dependence on ad by N. \end{DoxyCompactList}\item 
\mbox{\label{structcont__ad__t_af7b9044b76ed3b86ce74e4e7215ca4c3}} 
int32 \textbf{ eof}
\begin{DoxyCompactList}\small\item\em Whether the source ad device has encountered E\+OF. \end{DoxyCompactList}\item 
\mbox{\label{structcont__ad__t_a55f701abf33b5f68f9ef4cbf95dfaf73}} 
int32 \textbf{ spf}
\begin{DoxyCompactList}\small\item\em Samples/frame; audio level is analyzed within frames. \end{DoxyCompactList}\item 
\mbox{\label{structcont__ad__t_a5c6edc6be287f3ae013c59fef90cb4bd}} 
int32 \textbf{ adbufsize}
\begin{DoxyCompactList}\small\item\em Buffer size (Number of samples) \end{DoxyCompactList}\item 
\mbox{\label{structcont__ad__t_a54e2013d9634ec473aaf79a606fb2e0f}} 
int32 \textbf{ prev\+\_\+sample}
\begin{DoxyCompactList}\small\item\em For pre-\/emphasis filter. \end{DoxyCompactList}\item 
\mbox{\label{structcont__ad__t_aa0617a92c549ac916258a54ec2cdc756}} 
int32 \textbf{ headfrm}
\begin{DoxyCompactList}\small\item\em Frame number in adbuf with unconsumed A/D data. \end{DoxyCompactList}\item 
\mbox{\label{structcont__ad__t_abed5c6e9a2e078b70fc4c30b667612b2}} 
int32 \textbf{ n\+\_\+frm}
\begin{DoxyCompactList}\small\item\em Number of complete frames of unconsumed A/D data in adbuf. \end{DoxyCompactList}\item 
\mbox{\label{structcont__ad__t_a7ae5362560d9edfa6c16555285487a7a}} 
int32 \textbf{ n\+\_\+sample}
\begin{DoxyCompactList}\small\item\em Number of samples of unconsumed data in adbuf. \end{DoxyCompactList}\item 
\mbox{\label{structcont__ad__t_a4ed32427e6a785b571b1346c85481899}} 
int32 \textbf{ tot\+\_\+frm}
\begin{DoxyCompactList}\small\item\em Total number of frames of A/D data read, including consumed ones. \end{DoxyCompactList}\item 
\mbox{\label{structcont__ad__t_af60b0f78f9959a25cf7e7bf4c4aab4d7}} 
int32 \textbf{ noise\+\_\+level}
\begin{DoxyCompactList}\small\item\em P\+WP\+: what we claim as the \char`\"{}current\char`\"{} noise level. \end{DoxyCompactList}\item 
\mbox{\label{structcont__ad__t_a01f61a105019bea12533db84351d07b9}} 
int32 $\ast$ \textbf{ pow\+\_\+hist}
\begin{DoxyCompactList}\small\item\em Histogram of frame power, moving window, decayed. \end{DoxyCompactList}\item 
\mbox{\label{structcont__ad__t_a18f146239c77ff4ca6157261acdf4083}} 
char $\ast$ \textbf{ frm\+\_\+pow}
\begin{DoxyCompactList}\small\item\em Frame power. \end{DoxyCompactList}\item 
\mbox{\label{structcont__ad__t_a9e23379bf649ee06ece20133316253e5}} 
int32 \textbf{ auto\+\_\+thresh}
\begin{DoxyCompactList}\small\item\em Do automatic threshold adjustment or not. \end{DoxyCompactList}\item 
\mbox{\label{structcont__ad__t_a74a6f56fb4cbde7fc789c9b463cf2f8f}} 
int32 \textbf{ delta\+\_\+sil}
\begin{DoxyCompactList}\small\item\em Max silence power/frame A\+B\+O\+VE noise level. \end{DoxyCompactList}\item 
\mbox{\label{structcont__ad__t_afca0f69a21d9f28c9610fcefc0e7cb10}} 
int32 \textbf{ delta\+\_\+speech}
\begin{DoxyCompactList}\small\item\em Min speech power/frame A\+B\+O\+VE noise level. \end{DoxyCompactList}\item 
\mbox{\label{structcont__ad__t_ac301114b24356aef2edccba155e3cf33}} 
int32 \textbf{ min\+\_\+noise}
\begin{DoxyCompactList}\small\item\em noise lower than this we ignore \end{DoxyCompactList}\item 
\mbox{\label{structcont__ad__t_af3b50663565964bb18ebb9f9e0002421}} 
int32 \textbf{ max\+\_\+noise}
\begin{DoxyCompactList}\small\item\em noise higher than this signals an error \end{DoxyCompactList}\item 
\mbox{\label{structcont__ad__t_a7c61513f48e8fbc9ab6b57db66dad7b9}} 
int32 \textbf{ winsize}
\begin{DoxyCompactList}\small\item\em how many frames to look at for speech det \end{DoxyCompactList}\item 
\mbox{\label{structcont__ad__t_a1b0bb7e53a2bf537ed362badddca341b}} 
int32 \textbf{ speech\+\_\+onset}
\begin{DoxyCompactList}\small\item\em start speech on $>$= these many frames out of winsize, of $>$= delta\+\_\+speech \end{DoxyCompactList}\item 
\mbox{\label{structcont__ad__t_a9f5e138f4b79b59bf4daa5603d171165}} 
int32 \textbf{ sil\+\_\+onset}
\begin{DoxyCompactList}\small\item\em end speech on $>$= these many frames out of winsize, of $<$= delta\+\_\+sil \end{DoxyCompactList}\item 
\mbox{\label{structcont__ad__t_a0d42e3ac6c1e5c59c86a40f4cf26a861}} 
int32 \textbf{ leader}
\begin{DoxyCompactList}\small\item\em pad beggining of speech with this many extra frms \end{DoxyCompactList}\item 
\mbox{\label{structcont__ad__t_aa15db1e9fbb0048225521555ab8d9388}} 
int32 \textbf{ trailer}
\begin{DoxyCompactList}\small\item\em pad end of speech with this many extra frms \end{DoxyCompactList}\item 
\mbox{\label{structcont__ad__t_a0b9333d9acc41b5bfb67f69fc22ca901}} 
int32 \textbf{ thresh\+\_\+speech}
\begin{DoxyCompactList}\small\item\em Frame considered to be speech if power $>$= thresh\+\_\+speech (for transitioning from S\+I\+L\+E\+N\+CE to S\+P\+E\+E\+CH state) \end{DoxyCompactList}\item 
\mbox{\label{structcont__ad__t_adbbe28dca87d06a3ca8d2390d08ea83a}} 
int32 \textbf{ thresh\+\_\+sil}
\begin{DoxyCompactList}\small\item\em Frame considered to be silence if power $<$= thresh\+\_\+sil (for transitioning from S\+P\+E\+E\+CH to S\+I\+L\+E\+N\+CE state) \end{DoxyCompactList}\item 
\mbox{\label{structcont__ad__t_a2168183b25add085cf3aa29ddab1c8ce}} 
int32 \textbf{ thresh\+\_\+update}
\begin{DoxyCompactList}\small\item\em Number of frames before next update to pow\+\_\+hist/thresholds. \end{DoxyCompactList}\item 
\mbox{\label{structcont__ad__t_ac22395096037175bf9a0a1f6877e5ec5}} 
float32 \textbf{ adapt\+\_\+rate}
\begin{DoxyCompactList}\small\item\em Linear interpolation constant for rate at which noise level adapted to each estimate; range\+: 0-\/1; 0=$>$ no adaptation, 1=$>$ instant adaptation. \end{DoxyCompactList}\item 
int32 \textbf{ tail\+\_\+state}
\begin{DoxyCompactList}\small\item\em State at the end of its internal buffer (internal use)\+: C\+O\+N\+T\+\_\+\+A\+D\+\_\+\+S\+T\+A\+T\+E\+\_\+\+S\+IL or C\+O\+N\+T\+\_\+\+A\+D\+\_\+\+S\+T\+A\+T\+E\+\_\+\+S\+P\+E\+E\+CH. \end{DoxyCompactList}\item 
\mbox{\label{structcont__ad__t_a75bc7d23bfedfd79a2fd1e3ea2188e4c}} 
int32 \textbf{ win\+\_\+startfrm}
\begin{DoxyCompactList}\small\item\em Where next analysis window begins. \end{DoxyCompactList}\item 
\mbox{\label{structcont__ad__t_a14ee16922e7287ad4ce8c51c6ddb74fc}} 
int32 \textbf{ win\+\_\+validfrm}
\begin{DoxyCompactList}\small\item\em Number of frames currently available from win\+\_\+startfrm for analysis. \end{DoxyCompactList}\item 
\mbox{\label{structcont__ad__t_a628e5b444bde5e0eb0dc7fe8731a31a6}} 
int32 \textbf{ n\+\_\+other}
\begin{DoxyCompactList}\small\item\em If in S\+I\+L\+E\+N\+CE state, number of frames in analysis window considered to be speech; otherwise number of frames considered to be silence. \end{DoxyCompactList}\item 
\mbox{\label{structcont__ad__t_abffe61140bc2a02ae4222183b3ef6159}} 
\textbf{ spseg\+\_\+t} $\ast$ \textbf{ spseg\+\_\+head}
\begin{DoxyCompactList}\small\item\em First of unconsumed speech segments. \end{DoxyCompactList}\item 
\mbox{\label{structcont__ad__t_ac77e8f8bd27cea3b99238d9663455972}} 
\textbf{ spseg\+\_\+t} $\ast$ \textbf{ spseg\+\_\+tail}
\begin{DoxyCompactList}\small\item\em Last of unconsumed speech segments. \end{DoxyCompactList}\item 
F\+I\+LE $\ast$ \textbf{ rawfp}
\begin{DoxyCompactList}\small\item\em If non-\/\+N\+U\+LL, raw audio input data processed by cont\+\_\+ad is dumped to this file. \end{DoxyCompactList}\item 
F\+I\+LE $\ast$ \textbf{ logfp}
\begin{DoxyCompactList}\small\item\em If non-\/\+N\+U\+LL, write detailed logs of this object\textquotesingle{}s progress to the file. \end{DoxyCompactList}\item 
int32 \textbf{ n\+\_\+calib\+\_\+frame}
\begin{DoxyCompactList}\small\item\em Number of frames of calibration data seen so far. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Continuous listening module or object Continuous listening module or object. 

An application can open and maintain several such objects, if necessary. F\+YI\+: Module always in one of two states\+: S\+I\+L\+E\+N\+CE or S\+P\+E\+E\+CH. Transitions between the two detected by sliding a window spanning several frames and looking for some minimum number of frames of the other type. 

Definition at line 151 of file cont\+\_\+ad.\+h.



\subsection{Field Documentation}
\mbox{\label{structcont__ad__t_aae5b9d977e62424b0cf0e245485b20a0}} 
\index{cont\+\_\+ad\+\_\+t@{cont\+\_\+ad\+\_\+t}!ad@{ad}}
\index{ad@{ad}!cont\+\_\+ad\+\_\+t@{cont\+\_\+ad\+\_\+t}}
\subsubsection{ad}
{\footnotesize\ttfamily \textbf{ ad\+\_\+rec\+\_\+t}$\ast$ cont\+\_\+ad\+\_\+t\+::ad}



A/D device argument for adfunc. 

Also, ad-\/$>$sps used to determine frame size (spf, see below) 

Definition at line 154 of file cont\+\_\+ad.\+h.



Referenced by cont\+\_\+ad\+\_\+buffer\+\_\+space().

\mbox{\label{structcont__ad__t_adbbb6765386309476549beb058a235c5}} 
\index{cont\+\_\+ad\+\_\+t@{cont\+\_\+ad\+\_\+t}!logfp@{logfp}}
\index{logfp@{logfp}!cont\+\_\+ad\+\_\+t@{cont\+\_\+ad\+\_\+t}}
\subsubsection{logfp}
{\footnotesize\ttfamily F\+I\+LE$\ast$ cont\+\_\+ad\+\_\+t\+::logfp}



If non-\/\+N\+U\+LL, write detailed logs of this object\textquotesingle{}s progress to the file. 

Controlled by user application via \doxyref{cont\+\_\+ad\+\_\+set\+\_\+logfp()}{p.}{cont__ad_8h_a16c5810eb19ed89522ef4c3394bbfe83}. N\+U\+LL when cont\+\_\+ad object is initially created. 

Definition at line 231 of file cont\+\_\+ad.\+h.

\mbox{\label{structcont__ad__t_ac6e6809727ddc78a13674478d5b527db}} 
\index{cont\+\_\+ad\+\_\+t@{cont\+\_\+ad\+\_\+t}!n\+\_\+calib\+\_\+frame@{n\+\_\+calib\+\_\+frame}}
\index{n\+\_\+calib\+\_\+frame@{n\+\_\+calib\+\_\+frame}!cont\+\_\+ad\+\_\+t@{cont\+\_\+ad\+\_\+t}}
\subsubsection{n\+\_\+calib\+\_\+frame}
{\footnotesize\ttfamily int32 cont\+\_\+ad\+\_\+t\+::n\+\_\+calib\+\_\+frame}



Number of frames of calibration data seen so far. 



Definition at line 236 of file cont\+\_\+ad.\+h.



Referenced by cont\+\_\+ad\+\_\+calib\+\_\+loop().

\mbox{\label{structcont__ad__t_af8cd2a7e0ef0f4e2c825c7812a091f9c}} 
\index{cont\+\_\+ad\+\_\+t@{cont\+\_\+ad\+\_\+t}!rawfp@{rawfp}}
\index{rawfp@{rawfp}!cont\+\_\+ad\+\_\+t@{cont\+\_\+ad\+\_\+t}}
\subsubsection{rawfp}
{\footnotesize\ttfamily F\+I\+LE$\ast$ cont\+\_\+ad\+\_\+t\+::rawfp}



If non-\/\+N\+U\+LL, raw audio input data processed by cont\+\_\+ad is dumped to this file. 

Controlled by user application via \doxyref{cont\+\_\+ad\+\_\+set\+\_\+rawfp()}{p.}{cont__ad_8h_a662ed7c409479060e3b5ac8eb7bd1865}. N\+U\+LL when cont\+\_\+ad object is initially created. 

Definition at line 227 of file cont\+\_\+ad.\+h.



Referenced by cont\+\_\+ad\+\_\+buffer\+\_\+space().

\mbox{\label{structcont__ad__t_a7b71e87abfcb3ca4ae73af34c86f955e}} 
\index{cont\+\_\+ad\+\_\+t@{cont\+\_\+ad\+\_\+t}!read\+\_\+ts@{read\+\_\+ts}}
\index{read\+\_\+ts@{read\+\_\+ts}!cont\+\_\+ad\+\_\+t@{cont\+\_\+ad\+\_\+t}}
\subsubsection{read\+\_\+ts}
{\footnotesize\ttfamily int32 cont\+\_\+ad\+\_\+t\+::read\+\_\+ts}



Absolute timestamp (total no. 

of raw samples consumed upto the most recent cont\+\_\+ad\+\_\+read call, starting from the very beginning). Note that this is a 32-\/bit integer; applications should guard against overflow. 

Definition at line 167 of file cont\+\_\+ad.\+h.

\mbox{\label{structcont__ad__t_a478939247e09a8ae142c8996ec17d8c8}} 
\index{cont\+\_\+ad\+\_\+t@{cont\+\_\+ad\+\_\+t}!seglen@{seglen}}
\index{seglen@{seglen}!cont\+\_\+ad\+\_\+t@{cont\+\_\+ad\+\_\+t}}
\subsubsection{seglen}
{\footnotesize\ttfamily int32 cont\+\_\+ad\+\_\+t\+::seglen}



Total no. 

of raw samples consumed in the segment returned by the most recent cont\+\_\+ad\+\_\+read call. Can be used to detect silence segments that have stretched long enough to terminate an utterance 

Definition at line 171 of file cont\+\_\+ad.\+h.

\mbox{\label{structcont__ad__t_a5524c052dcd0a3d1a1c3b1fc2134b62e}} 
\index{cont\+\_\+ad\+\_\+t@{cont\+\_\+ad\+\_\+t}!siglvl@{siglvl}}
\index{siglvl@{siglvl}!cont\+\_\+ad\+\_\+t@{cont\+\_\+ad\+\_\+t}}
\subsubsection{siglvl}
{\footnotesize\ttfamily int32 cont\+\_\+ad\+\_\+t\+::siglvl}



Max signal level for the data consumed by the most recent cont\+\_\+ad\+\_\+read call (dB range\+: 0-\/99). 

Can be used to update a V-\/U meter, for example. 

Definition at line 175 of file cont\+\_\+ad.\+h.

\mbox{\label{structcont__ad__t_a11a4bb48870007b39f8fa46e4b8f111a}} 
\index{cont\+\_\+ad\+\_\+t@{cont\+\_\+ad\+\_\+t}!sps@{sps}}
\index{sps@{sps}!cont\+\_\+ad\+\_\+t@{cont\+\_\+ad\+\_\+t}}
\subsubsection{sps}
{\footnotesize\ttfamily int32 cont\+\_\+ad\+\_\+t\+::sps}



Samples/sec; moved from ad-\/$>$sps to break dependence on ad by N. 

Roy. 

Definition at line 180 of file cont\+\_\+ad.\+h.



Referenced by cont\+\_\+ad\+\_\+powhist\+\_\+dump().

\mbox{\label{structcont__ad__t_a5d9420ea711733d1eea9b8f29a638fdb}} 
\index{cont\+\_\+ad\+\_\+t@{cont\+\_\+ad\+\_\+t}!state@{state}}
\index{state@{state}!cont\+\_\+ad\+\_\+t@{cont\+\_\+ad\+\_\+t}}
\subsubsection{state}
{\footnotesize\ttfamily int32 cont\+\_\+ad\+\_\+t\+::state}



State of data returned by most recent cont\+\_\+ad\+\_\+read call; C\+O\+N\+T\+\_\+\+A\+D\+\_\+\+S\+T\+A\+T\+E\+\_\+\+S\+IL or C\+O\+N\+T\+\_\+\+A\+D\+\_\+\+S\+T\+A\+T\+E\+\_\+\+S\+P\+E\+E\+CH. 



Definition at line 165 of file cont\+\_\+ad.\+h.

\mbox{\label{structcont__ad__t_ae52185e7f7dfe424060c0ff562a8858b}} 
\index{cont\+\_\+ad\+\_\+t@{cont\+\_\+ad\+\_\+t}!tail\+\_\+state@{tail\+\_\+state}}
\index{tail\+\_\+state@{tail\+\_\+state}!cont\+\_\+ad\+\_\+t@{cont\+\_\+ad\+\_\+t}}
\subsubsection{tail\+\_\+state}
{\footnotesize\ttfamily int32 cont\+\_\+ad\+\_\+t\+::tail\+\_\+state}



State at the end of its internal buffer (internal use)\+: C\+O\+N\+T\+\_\+\+A\+D\+\_\+\+S\+T\+A\+T\+E\+\_\+\+S\+IL or C\+O\+N\+T\+\_\+\+A\+D\+\_\+\+S\+T\+A\+T\+E\+\_\+\+S\+P\+E\+E\+CH. 

Note\+: This is different from \doxyref{cont\+\_\+ad\+\_\+t.\+state}{p.}{structcont__ad__t_a5d9420ea711733d1eea9b8f29a638fdb}. 

Definition at line 217 of file cont\+\_\+ad.\+h.



Referenced by cont\+\_\+ad\+\_\+buffer\+\_\+space(), and cont\+\_\+set\+\_\+thresh().



The documentation for this struct was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
include/sphinxbase/\textbf{ cont\+\_\+ad.\+h}\end{DoxyCompactItemize}
