Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 208eeb8b1b7bb51bba095eb93ef0795f > files > 95

libccaudio0.5-0.5.3-1mdk.i586.rpm

\section{Audio\-Codec  Class Reference}
\label{class_audio_codec}\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 \char`\"{}sample\char`\"{} buffer. process codec interface. 


{\tt \#include $<$audio.h$>$}

Inheritance diagram for Audio\-Codec::\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=2cm]{class_audio_codec}
\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 bool {\bf Encode} ({\bf Audio\-Sample} $\ast$sample)=0
\begin{CompactList}\small\item\em Encode an \char`\"{}Audio\-Samples\char`\"{} object into the new encoding scheme if conversion is supported.\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 bool {\bf Decode} ({\bf Audio\-Sample} $\ast$sample)=0
\begin{CompactList}\small\item\em Decode into an :{\bf Audio\-Sample} {\rm (p.\,\pageref{class_audio_sample})}\char`\"{} if the conversion is supported.\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 \char`\"{}sample\char`\"{} 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_audio_sample})}. 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[Author: ]\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_audio_codec_b0}




\subsection{Member Function Documentation}
\index{AudioCodec@{Audio\-Codec}!Decode@{Decode}}
\index{Decode@{Decode}!AudioCodec@{Audio\-Codec}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual bool Audio\-Codec::Decode ({\bf Audio\-Sample} $\ast$ {\em sample})\hspace{0.3cm}{\tt  [pure virtual]}}\label{class_audio_codec_a3}


Decode into an :{\bf Audio\-Sample} {\rm (p.\,\pageref{class_audio_sample})}\char`\"{} if the conversion is supported.

\begin{Desc}
\item[Returns: ]\par
true if successful. \end{Desc}
\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
object}]to save into. \end{description}
\end{Desc}
\index{AudioCodec@{Audio\-Codec}!Decode@{Decode}}
\index{Decode@{Decode}!AudioCodec@{Audio\-Codec}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual unsigned Audio\-Codec::Decode (unsigned short $\ast$ {\em buffer}, int {\em channel} = 0)\hspace{0.3cm}{\tt  [pure virtual]}}\label{class_audio_codec_a2}


Decode the sample frame into linear samples.

\begin{Desc}
\item[Returns: ]\par
number of samples extracted. \end{Desc}
\begin{Desc}
\item[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}virtual bool Audio\-Codec::Encode ({\bf Audio\-Sample} $\ast$ {\em sample})\hspace{0.3cm}{\tt  [pure virtual]}}\label{class_audio_codec_a1}


Encode an \char`\"{}Audio\-Samples\char`\"{} object into the new encoding scheme if conversion is supported.

\begin{Desc}
\item[Returns: ]\par
true if successful. \end{Desc}
\begin{Desc}
\item[Parameters: ]\par
\begin{description}
\item[{\em 
object}]source. \end{description}
\end{Desc}
\index{AudioCodec@{Audio\-Codec}!Encode@{Encode}}
\index{Encode@{Encode}!AudioCodec@{Audio\-Codec}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}virtual 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_audio_codec_a0}


Encode a linear sample frame into the codec sample buffer.

\begin{Desc}
\item[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}virtual unsigned Audio\-Codec::Load (unsigned char $\ast$ {\em data}, unsigned {\em length})\hspace{0.3cm}{\tt  [virtual]}}\label{class_audio_codec_a4}


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[Returns: ]\par
number of bytes actually read into codec workspace. \end{Desc}
\begin{Desc}
\item[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}virtual unsigned Audio\-Codec::Save (unsigned char $\ast$ {\em data}, unsigned {\em length})\hspace{0.3cm}{\tt  [virtual]}}\label{class_audio_codec_a5}


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[Returns: ]\par
number of bytes actually written to workspace. \end{Desc}
\begin{Desc}
\item[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}virtual unsigned Audio\-Codec::get\-Channels (void)\hspace{0.3cm}{\tt  [virtual]}}\label{class_audio_codec_a8}


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_audio_codec_a7}


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_audio_codec_a6}


Get current number of samples of data, based on load or encode.

\begin{Desc}
\item[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_audio_codec_n0}




The documentation for this class was generated from the following file:\begin{CompactItemize}
\item 
{\bf audio.h}\end{CompactItemize}