\doxysection{ad\+\_\+base.\+c}
\label{ad__base_8c_source}\index{src/libsphinxad/ad\_base.c@{src/libsphinxad/ad\_base.c}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{comment}{/*\ -\/*-\/\ c-\/basic-\/offset:\ 4;\ indent-\/tabs-\/mode:\ nil\ -\/*-\/\ */}}
\DoxyCodeLine{00002\ \textcolor{comment}{/*\ ====================================================================}}
\DoxyCodeLine{00003\ \textcolor{comment}{\ *\ Copyright\ (c)\ 1999-\/2001\ Carnegie\ Mellon\ University.\ \ All\ rights}}
\DoxyCodeLine{00004\ \textcolor{comment}{\ *\ reserved.}}
\DoxyCodeLine{00005\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00006\ \textcolor{comment}{\ *\ Redistribution\ and\ use\ in\ source\ and\ binary\ forms,\ with\ or\ without}}
\DoxyCodeLine{00007\ \textcolor{comment}{\ *\ modification,\ are\ permitted\ provided\ that\ the\ following\ conditions}}
\DoxyCodeLine{00008\ \textcolor{comment}{\ *\ are\ met:}}
\DoxyCodeLine{00009\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00010\ \textcolor{comment}{\ *\ 1.\ Redistributions\ of\ source\ code\ must\ retain\ the\ above\ copyright}}
\DoxyCodeLine{00011\ \textcolor{comment}{\ *\ \ \ \ notice,\ this\ list\ of\ conditions\ and\ the\ following\ disclaimer.\ }}
\DoxyCodeLine{00012\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00013\ \textcolor{comment}{\ *\ 2.\ Redistributions\ in\ binary\ form\ must\ reproduce\ the\ above\ copyright}}
\DoxyCodeLine{00014\ \textcolor{comment}{\ *\ \ \ \ notice,\ this\ list\ of\ conditions\ and\ the\ following\ disclaimer\ in}}
\DoxyCodeLine{00015\ \textcolor{comment}{\ *\ \ \ \ the\ documentation\ and/or\ other\ materials\ provided\ with\ the}}
\DoxyCodeLine{00016\ \textcolor{comment}{\ *\ \ \ \ distribution.}}
\DoxyCodeLine{00017\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00018\ \textcolor{comment}{\ *\ This\ work\ was\ supported\ in\ part\ by\ funding\ from\ the\ Defense\ Advanced\ }}
\DoxyCodeLine{00019\ \textcolor{comment}{\ *\ Research\ Projects\ Agency\ and\ the\ National\ Science\ Foundation\ of\ the\ }}
\DoxyCodeLine{00020\ \textcolor{comment}{\ *\ United\ States\ of\ America,\ and\ the\ CMU\ Sphinx\ Speech\ Consortium.}}
\DoxyCodeLine{00021\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00022\ \textcolor{comment}{\ *\ THIS\ SOFTWARE\ IS\ PROVIDED\ BY\ CARNEGIE\ MELLON\ UNIVERSITY\ \`{}\`{}AS\ IS''\ AND\ }}
\DoxyCodeLine{00023\ \textcolor{comment}{\ *\ ANY\ EXPRESSED\ OR\ IMPLIED\ WARRANTIES,\ INCLUDING,\ BUT\ NOT\ LIMITED\ TO,\ }}
\DoxyCodeLine{00024\ \textcolor{comment}{\ *\ THE\ IMPLIED\ WARRANTIES\ OF\ MERCHANTABILITY\ AND\ FITNESS\ FOR\ A\ PARTICULAR}}
\DoxyCodeLine{00025\ \textcolor{comment}{\ *\ PURPOSE\ ARE\ DISCLAIMED.\ \ IN\ NO\ EVENT\ SHALL\ CARNEGIE\ MELLON\ UNIVERSITY}}
\DoxyCodeLine{00026\ \textcolor{comment}{\ *\ NOR\ ITS\ EMPLOYEES\ BE\ LIABLE\ FOR\ ANY\ DIRECT,\ INDIRECT,\ INCIDENTAL,}}
\DoxyCodeLine{00027\ \textcolor{comment}{\ *\ SPECIAL,\ EXEMPLARY,\ OR\ CONSEQUENTIAL\ DAMAGES\ (INCLUDING,\ BUT\ NOT\ }}
\DoxyCodeLine{00028\ \textcolor{comment}{\ *\ LIMITED\ TO,\ PROCUREMENT\ OF\ SUBSTITUTE\ GOODS\ OR\ SERVICES;\ LOSS\ OF\ USE,\ }}
\DoxyCodeLine{00029\ \textcolor{comment}{\ *\ DATA,\ OR\ PROFITS;\ OR\ BUSINESS\ INTERRUPTION)\ HOWEVER\ CAUSED\ AND\ ON\ ANY\ }}
\DoxyCodeLine{00030\ \textcolor{comment}{\ *\ THEORY\ OF\ LIABILITY,\ WHETHER\ IN\ CONTRACT,\ STRICT\ LIABILITY,\ OR\ TORT\ }}
\DoxyCodeLine{00031\ \textcolor{comment}{\ *\ (INCLUDING\ NEGLIGENCE\ OR\ OTHERWISE)\ ARISING\ IN\ ANY\ WAY\ OUT\ OF\ THE\ USE\ }}
\DoxyCodeLine{00032\ \textcolor{comment}{\ *\ OF\ THIS\ SOFTWARE,\ EVEN\ IF\ ADVISED\ OF\ THE\ POSSIBILITY\ OF\ SUCH\ DAMAGE.}}
\DoxyCodeLine{00033\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00034\ \textcolor{comment}{\ *\ ====================================================================}}
\DoxyCodeLine{00035\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00036\ \textcolor{comment}{\ */}}
\DoxyCodeLine{00037\ }
\DoxyCodeLine{00038\ \textcolor{comment}{/*}}
\DoxyCodeLine{00039\ \textcolor{comment}{\ *\ ad.c\ -\/-\/\ Wraps\ a\ "{}sphinx-\/II\ standard"{}\ audio\ interface\ around\ the\ basic\ audio}}
\DoxyCodeLine{00040\ \textcolor{comment}{\ *\ \ \ \ \ \ \ \ \ \ \ \ \ \ utilities.}}
\DoxyCodeLine{00041\ \textcolor{comment}{\ *}}
\DoxyCodeLine{00042\ \textcolor{comment}{\ *\ HISTORY}}
\DoxyCodeLine{00043\ \textcolor{comment}{\ *\ }}
\DoxyCodeLine{00044\ \textcolor{comment}{\ *\ 11-\/Jun-\/96\ \ \ \ M\ K\ Ravishankar\ (rkm@cs.cmu.edu)\ at\ Carnegie\ Mellon\ University.}}
\DoxyCodeLine{00045\ \textcolor{comment}{\ *\ \ \ \ \ \ \ \ \ \ \ \ \ \ Modified\ to\ conform\ to\ new\ A/D\ API.}}
\DoxyCodeLine{00046\ \textcolor{comment}{\ *\ }}
\DoxyCodeLine{00047\ \textcolor{comment}{\ *\ 12-\/May-\/96\ \ \ \ M\ K\ Ravishankar\ (rkm@cs.cmu.edu)\ at\ Carnegie\ Mellon\ University.}}
\DoxyCodeLine{00048\ \textcolor{comment}{\ *\ \ \ \ \ \ \ \ \ \ \ \ \ \ Dummy\ template\ created.}}
\DoxyCodeLine{00049\ \textcolor{comment}{\ */}}
\DoxyCodeLine{00050\ }
\DoxyCodeLine{00051\ \textcolor{preprocessor}{\#include\ <stdio.h>}}
\DoxyCodeLine{00052\ \textcolor{preprocessor}{\#include\ <string.h>}}
\DoxyCodeLine{00053\ \textcolor{preprocessor}{\#include\ <config.h>}}
\DoxyCodeLine{00054\ }
\DoxyCodeLine{00055\ \textcolor{preprocessor}{\#include\ "{}prim\_type.h"{}}}
\DoxyCodeLine{00056\ \textcolor{preprocessor}{\#include\ "{}ad.h"{}}}
\DoxyCodeLine{00057\ }
\DoxyCodeLine{00058\ \textcolor{preprocessor}{\#define\ QUIT(x)\ \ \ \ \ \ \ \ \ \{fprintf\ x;\ exit(-\/1);\}}}
\DoxyCodeLine{00059\ }
\DoxyCodeLine{00060\ }
\DoxyCodeLine{00061\ ad\_rec\_t\ *}
\DoxyCodeLine{00062\ ad\_open\_dev(\textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *dev,\ int32\ samples\_per\_sec)}
\DoxyCodeLine{00063\ \{}
\DoxyCodeLine{00064\ \ \ \ \ fprintf(stderr,\ \textcolor{stringliteral}{"{}A/D\ library\ not\ implemented\(\backslash\)n"{}});}
\DoxyCodeLine{00065\ \ \ \ \ \textcolor{keywordflow}{return}\ NULL;}
\DoxyCodeLine{00066\ \}}
\DoxyCodeLine{00067\ }
\DoxyCodeLine{00068\ }
\DoxyCodeLine{00069\ ad\_rec\_t\ *}
\DoxyCodeLine{00070\ ad\_open\_sps(int32\ samples\_per\_sec)}
\DoxyCodeLine{00071\ \{}
\DoxyCodeLine{00072\ \ \ \ \ fprintf(stderr,\ \textcolor{stringliteral}{"{}A/D\ library\ not\ implemented\(\backslash\)n"{}});}
\DoxyCodeLine{00073\ \ \ \ \ \textcolor{keywordflow}{return}\ NULL;}
\DoxyCodeLine{00074\ \}}
\DoxyCodeLine{00075\ }
\DoxyCodeLine{00076\ ad\_rec\_t\ *}
\DoxyCodeLine{00077\ ad\_open(\textcolor{keywordtype}{void})}
\DoxyCodeLine{00078\ \{}
\DoxyCodeLine{00079\ \ \ \ \ \textcolor{keywordflow}{return}\ ad\_open\_sps(DEFAULT\_SAMPLES\_PER\_SEC);}
\DoxyCodeLine{00080\ \}}
\DoxyCodeLine{00081\ }
\DoxyCodeLine{00082\ }
\DoxyCodeLine{00083\ int32}
\DoxyCodeLine{00084\ ad\_start\_rec(ad\_rec\_t\ *\ r)}
\DoxyCodeLine{00085\ \{}
\DoxyCodeLine{00086\ \ \ \ \ \textcolor{keywordflow}{return}\ -\/1;}
\DoxyCodeLine{00087\ \}}
\DoxyCodeLine{00088\ }
\DoxyCodeLine{00089\ }
\DoxyCodeLine{00090\ int32}
\DoxyCodeLine{00091\ ad\_stop\_rec(ad\_rec\_t\ *\ r)}
\DoxyCodeLine{00092\ \{}
\DoxyCodeLine{00093\ \ \ \ \ \textcolor{keywordflow}{return}\ -\/1;}
\DoxyCodeLine{00094\ \}}
\DoxyCodeLine{00095\ }
\DoxyCodeLine{00096\ }
\DoxyCodeLine{00097\ int32}
\DoxyCodeLine{00098\ ad\_read(ad\_rec\_t\ *\ r,\ int16\ *\ buf,\ int32\ max)}
\DoxyCodeLine{00099\ \{}
\DoxyCodeLine{00100\ \ \ \ \ \textcolor{keywordflow}{return}\ -\/1;}
\DoxyCodeLine{00101\ \}}
\DoxyCodeLine{00102\ }
\DoxyCodeLine{00103\ }
\DoxyCodeLine{00104\ int32}
\DoxyCodeLine{00105\ ad\_close(ad\_rec\_t\ *\ r)}
\DoxyCodeLine{00106\ \{}
\DoxyCodeLine{00107\ \ \ \ \ \textcolor{keywordflow}{return}\ 0;}
\DoxyCodeLine{00108\ \}}

\end{DoxyCode}
