<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><meta name="robots" content="noindex"> <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>AudioCodec class Reference</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body bgcolor="#ffffff"> <!-- Generated by Doxygen 1.2.5 on Fri Oct 5 09:43:52 2001 --> <center> <a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> <a class="qindex" href="globals.html">File Members</a> </center> <hr><h1>AudioCodec Class Reference</h1>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. <a href="#_details">More...</a> <p> <code>#include <<a class="el" href="audio_h-source.html">audio.h</a>></code> <p> <p>Inheritance diagram for AudioCodec: <p><center><img src="class_audiocodec.gif" usemap="#AudioCodec_map" border="0"></center> <map name="AudioCodec_map"> <area href="class_audiosample.html" alt="AudioSample" shape="rect" coords="0,0,86,24"> </map> <a href="class_audiocodec-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0> <tr><td colspan=2><br><h2>Public Methods</h2></td></tr> <tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="class_audiocodec.html#a0">Encode</a> (unsigned short *buffer, unsigned <a class="el" href="class_audiosample.html#n3">samples</a>=0, int channel=0)=0</td></tr> <tr><td> </td><td><font size=-1><em>Encode a linear sample frame into the codec sample buffer.</em> <a href="#a0">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>virtual unsigned </td><td valign=bottom><a class="el" href="class_audiocodec.html#a1">Decode</a> (unsigned short *buffer, int channel=0)=0</td></tr> <tr><td> </td><td><font size=-1><em>Decode the sample frame into linear samples.</em> <a href="#a1">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>virtual unsigned </td><td valign=bottom><a class="el" href="class_audiocodec.html#a2">Load</a> (unsigned char *data, unsigned <a class="el" href="class_audiocodec.html#n0">length</a>)</td></tr> <tr><td> </td><td><font size=-1><em>Load a codec from a byte stream data source.</em> <a href="#a2">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>virtual unsigned </td><td valign=bottom><a class="el" href="class_audiocodec.html#a3">Save</a> (unsigned char *data, unsigned <a class="el" href="class_audiocodec.html#n0">length</a>)</td></tr> <tr><td> </td><td><font size=-1><em>Save a codec to a byte stream data source.</em> <a href="#a3">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>unsigned </td><td valign=bottom><a class="el" href="class_audiocodec.html#a4">getLength</a> (void)</td></tr> <tr><td> </td><td><font size=-1><em>Get current number of samples of data, based on load or encode.</em> <a href="#a4">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>unsigned </td><td valign=bottom><a class="el" href="class_audiocodec.html#a5">getFrameSize</a> (void)</td></tr> <tr><td> </td><td><font size=-1><em>Get size of the audio frame.</em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>virtual unsigned </td><td valign=bottom><a class="el" href="class_audiocodec.html#a6">getChannels</a> (void)</td></tr> <tr><td> </td><td><font size=-1><em>Check if stereo/multi-channel codec.</em></font><br><br></td></tr> <tr><td colspan=2><br><h2>Protected Methods</h2></td></tr> <tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="class_audiocodec.html#b0">AudioCodec</a> (unsigned frames, <a class="el" href="audio_h.html#a56">audioencoding_t</a> <a class="el" href="class_audiosample.html#n0">encoding</a>, unsigned <a class="el" href="class_audiosample.html#n1">rate</a>)</td></tr> <tr><td colspan=2><br><h2>Protected Attributes</h2></td></tr> <tr><td nowrap align=right valign=top>unsigned </td><td valign=bottom><a class="el" href="class_audiocodec.html#n0">length</a></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> 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. <p> This class is only abstract and describes the core interface for loadable codec modules. This class is normally merged with <a class="el" href="class_audiosample.html">AudioSample</a>. A derived AudioCodecXXX will typically include a AudioRegisterXXX static class to automatically initialize and register the codec with the codec registry. <p> <dl compact><dt> <b>Author(s): </b><dd> David Sugar <<a href="mailto:dyfet@ostel.com">dyfet@ostel.com</a>> </dl> <p> <hr><h2>Constructor & Destructor Documentation</h2> <a name="b0" doxytag="AudioCodec::AudioCodec"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td nowrap valign="top"><b> AudioCodec::AudioCodec ( </b></td> <td valign="bottom"><b> unsigned <em>frames</em>, </b></td> </tr> <tr> <td></td> <td><b> <a class="el" href="audio_h.html#a56">audioencoding_t</a> <em>encoding</em>, </b></td> </tr> <tr> <td></td> <td><b> unsigned <em>rate</em> )<code> [protected]</code> </b></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> </td> </tr> </table> <hr><h2>Member Function Documentation</h2> <a name="a1" doxytag="AudioCodec::Decode"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td nowrap valign="top"><b> unsigned AudioCodec::Decode ( </b></td> <td valign="bottom"><b> unsigned short * <em>buffer</em>, </b></td> </tr> <tr> <td></td> <td><b> int <em>channel</em> = 0 )<code> [pure virtual]</code> </b></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Decode the sample frame into linear samples. <p> <dl compact><dt> <b>Returns: </b><dd> number of samples extracted. </dl><dl compact><dt> <b>Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>sample</em> </td><td> buffer to save linear samples into. </td></tr> <tr><td valign=top><em>channel</em> </td><td> number or 0 for all channels. </td></tr> </table> </dl> </td> </tr> </table> <a name="a0" doxytag="AudioCodec::Encode"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td nowrap valign="top"><b> void AudioCodec::Encode ( </b></td> <td valign="bottom"><b> unsigned short * <em>buffer</em>, </b></td> </tr> <tr> <td></td> <td><b> unsigned <em>samples</em> = 0, </b></td> </tr> <tr> <td></td> <td><b> int <em>channel</em> = 0 )<code> [pure virtual]</code> </b></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Encode a linear sample frame into the codec sample buffer. <p> <dl compact><dt> <b>Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>linear</em> </td><td> sample buffer to encode. </td></tr> <tr><td valign=top><em>number</em> </td><td> of samples, or use default count. </td></tr> <tr><td valign=top><em>channel</em> </td><td> number or 0 for all channels. </td></tr> </table> </dl> </td> </tr> </table> <a name="a2" doxytag="AudioCodec::Load"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td nowrap valign="top"><b> unsigned AudioCodec::Load ( </b></td> <td valign="bottom"><b> unsigned char * <em>data</em>, </b></td> </tr> <tr> <td></td> <td><b> unsigned <em>length</em> )<code> [virtual]</code> </b></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Load a codec from a byte stream data source. <p> This is used for streaming of compressed codec's where frames are of irregular sizes. <p> <dl compact><dt> <b>Returns: </b><dd> number of bytes actually read into codec workspace. </dl><dl compact><dt> <b>Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>pointer</em> </td><td> to byte data stream. </td></tr> <tr><td valign=top><em>number</em> </td><td> of data bytes. </td></tr> </table> </dl> </td> </tr> </table> <a name="a3" doxytag="AudioCodec::Save"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td nowrap valign="top"><b> unsigned AudioCodec::Save ( </b></td> <td valign="bottom"><b> unsigned char * <em>data</em>, </b></td> </tr> <tr> <td></td> <td><b> unsigned <em>length</em> )<code> [virtual]</code> </b></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Save a codec to a byte stream data source. <p> This is used for streaming of compressed codec's where frames are of irregular sizes. <p> <dl compact><dt> <b>Returns: </b><dd> number of bytes actually written to workspace. </dl><dl compact><dt> <b>Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>pointer</em> </td><td> to byte data stream. </td></tr> <tr><td valign=top><em>size</em> </td><td> of byte data stream. </td></tr> </table> </dl> </td> </tr> </table> <a name="a6" doxytag="AudioCodec::getChannels"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td nowrap valign="top"><b> unsigned AudioCodec::getChannels ( </b></td> <td valign="bottom"><b> void )<code> [virtual]</code> </b></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Check if stereo/multi-channel codec. <p> </td> </tr> </table> <a name="a5" doxytag="AudioCodec::getFrameSize"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td nowrap valign="top"><b> unsigned AudioCodec::getFrameSize ( </b></td> <td valign="bottom"><b> void ) </b></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Get size of the audio frame. <p> </td> </tr> </table> <a name="a4" doxytag="AudioCodec::getLength"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td nowrap valign="top"><b> unsigned AudioCodec::getLength ( </b></td> <td valign="bottom"><b> void )<code> [inline]</code> </b></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Get current number of samples of data, based on load or encode. <p> <dl compact><dt> <b>Returns: </b><dd> length. </dl> </td> </tr> </table> <hr><h2>Member Data Documentation</h2> <a name="n0" doxytag="AudioCodec::length"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td nowrap valign="top"><b> unsigned AudioCodec::length<code> [protected]</code> </b></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> </td> </tr> </table> <hr>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="audio_h-source.html">audio.h</a></ul> <hr><address><small>Generated at Fri Oct 5 09:43:52 2001 for ccaudio by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.gif" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.2.5 written by <a href="mailto:dimitri@stack.nl">Dimitri van Heesch</a>, © 1997-2001</small></address> </body> </html>