\section{Audio\-Codec Class Reference} \label{class_audiocodec}\index{AudioCodec@{Audio\-Codec}} The codec class is a virtual used for transcoding audio samples between linear frames (or other known format) and an encoded "sample" buffer. process codec interface. {\tt \#include $<$audio.h$>$} Inheritance diagram for Audio\-Codec:\begin{figure}[H] \begin{center} \leavevmode \includegraphics[height=2cm]{class_audiocodec} \end{center} \end{figure} \subsection*{Public Methods} \begin{CompactItemize} \item virtual void {\bf Encode} (unsigned short $\ast$buffer, unsigned {\bf samples}=0, int channel=0)=0 \begin{CompactList}\small\item\em Encode a linear sample frame into the codec sample buffer.\item\end{CompactList}\item virtual unsigned {\bf Decode} (unsigned short $\ast$buffer, int channel=0)=0 \begin{CompactList}\small\item\em Decode the sample frame into linear samples.\item\end{CompactList}\item virtual unsigned {\bf Load} (unsigned char $\ast$data, unsigned {\bf length}) \begin{CompactList}\small\item\em Load a codec from a byte stream data source.\item\end{CompactList}\item virtual unsigned {\bf Save} (unsigned char $\ast$data, unsigned {\bf length}) \begin{CompactList}\small\item\em Save a codec to a byte stream data source.\item\end{CompactList}\item unsigned {\bf get\-Length} (void) \begin{CompactList}\small\item\em Get current number of samples of data, based on load or encode.\item\end{CompactList}\item unsigned {\bf get\-Frame\-Size} (void) \begin{CompactList}\small\item\em Get size of the audio frame.\item\end{CompactList}\item virtual unsigned {\bf get\-Channels} (void) \begin{CompactList}\small\item\em Check if stereo/multi-channel codec.\item\end{CompactList}\end{CompactItemize} \subsection*{Protected Methods} \begin{CompactItemize} \item {\bf Audio\-Codec} (unsigned frames, {\bf audioencoding\_\-t} {\bf encoding}, unsigned {\bf rate}) \end{CompactItemize} \subsection*{Protected Attributes} \begin{CompactItemize} \item unsigned {\bf length} \end{CompactItemize} \subsection{Detailed Description} The codec class is a virtual used for transcoding audio samples between linear frames (or other known format) and an encoded "sample" buffer. process codec interface. This class is only abstract and describes the core interface for loadable codec modules. This class is normally merged with {\bf Audio\-Sample} {\rm (p.\,\pageref{class_audiosample})}. A derived Audio\-Codec\-XXX will typically include a Audio\-Register\-XXX static class to automatically initialize and register the codec with the codec registry. \begin{Desc} \item[{\bf Author(s): }]\par David Sugar $<${\tt dyfet@ostel.com}$>$ \end{Desc} \subsection{Constructor \& Destructor Documentation} \index{AudioCodec@{Audio\-Codec}!AudioCodec@{AudioCodec}} \index{AudioCodec@{AudioCodec}!AudioCodec@{Audio\-Codec}} \subsubsection{\setlength{\rightskip}{0pt plus 5cm}Audio\-Codec::Audio\-Codec (unsigned {\em frames}, {\bf audioencoding\_\-t} {\em encoding}, unsigned {\em rate})\hspace{0.3cm}{\tt [protected]}}\label{class_audiocodec_b0} \subsection{Member Function Documentation} \index{AudioCodec@{Audio\-Codec}!Decode@{Decode}} \index{Decode@{Decode}!AudioCodec@{Audio\-Codec}} \subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned Audio\-Codec::Decode (unsigned short $\ast$ {\em buffer}, int {\em channel} = 0)\hspace{0.3cm}{\tt [pure virtual]}}\label{class_audiocodec_a1} Decode the sample frame into linear samples. \begin{Desc} \item[{\bf Returns: }]\par number of samples extracted. \end{Desc} \begin{Desc} \item[{\bf Parameters: }]\par \begin{description} \item[ {\em sample}] buffer to save linear samples into. \item[ {\em channel}] number or 0 for all channels. \end{description} \end{Desc} \index{AudioCodec@{Audio\-Codec}!Encode@{Encode}} \index{Encode@{Encode}!AudioCodec@{Audio\-Codec}} \subsubsection{\setlength{\rightskip}{0pt plus 5cm}void Audio\-Codec::Encode (unsigned short $\ast$ {\em buffer}, unsigned {\em samples} = 0, int {\em channel} = 0)\hspace{0.3cm}{\tt [pure virtual]}}\label{class_audiocodec_a0} Encode a linear sample frame into the codec sample buffer. \begin{Desc} \item[{\bf Parameters: }]\par \begin{description} \item[ {\em linear}] sample buffer to encode. \item[ {\em number}] of samples, or use default count. \item[ {\em channel}] number or 0 for all channels. \end{description} \end{Desc} \index{AudioCodec@{Audio\-Codec}!Load@{Load}} \index{Load@{Load}!AudioCodec@{Audio\-Codec}} \subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned Audio\-Codec::Load (unsigned char $\ast$ {\em data}, unsigned {\em length})\hspace{0.3cm}{\tt [virtual]}}\label{class_audiocodec_a2} Load a codec from a byte stream data source. This is used for streaming of compressed codec's where frames are of irregular sizes. \begin{Desc} \item[{\bf Returns: }]\par number of bytes actually read into codec workspace. \end{Desc} \begin{Desc} \item[{\bf Parameters: }]\par \begin{description} \item[ {\em pointer}] to byte data stream. \item[ {\em number}] of data bytes. \end{description} \end{Desc} \index{AudioCodec@{Audio\-Codec}!Save@{Save}} \index{Save@{Save}!AudioCodec@{Audio\-Codec}} \subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned Audio\-Codec::Save (unsigned char $\ast$ {\em data}, unsigned {\em length})\hspace{0.3cm}{\tt [virtual]}}\label{class_audiocodec_a3} Save a codec to a byte stream data source. This is used for streaming of compressed codec's where frames are of irregular sizes. \begin{Desc} \item[{\bf Returns: }]\par number of bytes actually written to workspace. \end{Desc} \begin{Desc} \item[{\bf Parameters: }]\par \begin{description} \item[ {\em pointer}] to byte data stream. \item[ {\em size}] of byte data stream. \end{description} \end{Desc} \index{AudioCodec@{Audio\-Codec}!getChannels@{getChannels}} \index{getChannels@{getChannels}!AudioCodec@{Audio\-Codec}} \subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned Audio\-Codec::get\-Channels (void)\hspace{0.3cm}{\tt [virtual]}}\label{class_audiocodec_a6} Check if stereo/multi-channel codec. \index{AudioCodec@{Audio\-Codec}!getFrameSize@{getFrameSize}} \index{getFrameSize@{getFrameSize}!AudioCodec@{Audio\-Codec}} \subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned Audio\-Codec::get\-Frame\-Size (void)}\label{class_audiocodec_a5} Get size of the audio frame. \index{AudioCodec@{Audio\-Codec}!getLength@{getLength}} \index{getLength@{getLength}!AudioCodec@{Audio\-Codec}} \subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned Audio\-Codec::get\-Length (void)\hspace{0.3cm}{\tt [inline]}}\label{class_audiocodec_a4} Get current number of samples of data, based on load or encode. \begin{Desc} \item[{\bf Returns: }]\par length. \end{Desc} \subsection{Member Data Documentation} \index{AudioCodec@{Audio\-Codec}!length@{length}} \index{length@{length}!AudioCodec@{Audio\-Codec}} \subsubsection{\setlength{\rightskip}{0pt plus 5cm}unsigned Audio\-Codec::length\hspace{0.3cm}{\tt [protected]}}\label{class_audiocodec_n0} The documentation for this class was generated from the following file:\begin{CompactItemize} \item {\bf audio.h}\end{CompactItemize}