<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>libfishsound: decode.h File Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.8 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> <li><a href="globals.html"><span>Globals</span></a></li> </ul> </div> </div> <div class="contents"> <h1>decode.h File Reference</h1>Decode functions and callback prototypes. <a href="#_details">More...</a> <p> <p> <a href="decode_8h-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> <tr><td colspan="2"><br><h2>Typedefs</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">typedef int(* </td><td class="memItemRight" valign="bottom"><a class="el" href="decode_8h.html#bc40e3343ebff3d1418835569079b2c8">FishSoundDecoded_Float</a> )(<a class="el" href="fishsound_8h.html#8cfb7dfb102ad1af9ff35046aed3ccd9">FishSound</a> *fsound, float *pcm[], long frames, void *user_data)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Signature of a callback for libfishsound to call when it has decoded PCM audio data, and you want this provided as non-interleaved floats. <a href="#bc40e3343ebff3d1418835569079b2c8"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">typedef int(* </td><td class="memItemRight" valign="bottom"><a class="el" href="decode_8h.html#8ba661947284a888e24f7e5d0b076828">FishSoundDecoded_FloatIlv</a> )(<a class="el" href="fishsound_8h.html#8cfb7dfb102ad1af9ff35046aed3ccd9">FishSound</a> *fsound, float **pcm, long frames, void *user_data)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Signature of a callback for libfishsound to call when it has decoded PCM audio data, and you want this provided as interleaved floats. <a href="#8ba661947284a888e24f7e5d0b076828"></a><br></td></tr> <tr><td colspan="2"><br><h2>Functions</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="decode_8h.html#e821800e11efe106676d7ce4c743328a">fish_sound_set_decoded_float</a> (<a class="el" href="fishsound_8h.html#8cfb7dfb102ad1af9ff35046aed3ccd9">FishSound</a> *fsound, <a class="el" href="decode_8h.html#bc40e3343ebff3d1418835569079b2c8">FishSoundDecoded_Float</a> decoded, void *user_data)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Set the callback for libfishsound to call when it has a block of decoded PCM audio ready, and you want this provided as non-interleaved floats. <a href="#e821800e11efe106676d7ce4c743328a"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="decode_8h.html#3a4055f579b841a5c05d2a2865f5e939">fish_sound_set_decoded_float_ilv</a> (<a class="el" href="fishsound_8h.html#8cfb7dfb102ad1af9ff35046aed3ccd9">FishSound</a> *fsound, <a class="el" href="decode_8h.html#8ba661947284a888e24f7e5d0b076828">FishSoundDecoded_FloatIlv</a> decoded, void *user_data)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Set the callback for libfishsound to call when it has a block of decoded PCM audio ready, and you want this provided as interleaved floats. <a href="#3a4055f579b841a5c05d2a2865f5e939"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">long </td><td class="memItemRight" valign="bottom"><a class="el" href="decode_8h.html#070a1843d6990a00e2471945d40645c7">fish_sound_decode</a> (<a class="el" href="fishsound_8h.html#8cfb7dfb102ad1af9ff35046aed3ccd9">FishSound</a> *fsound, unsigned char *buf, long bytes)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Decode a block of compressed data. <a href="#070a1843d6990a00e2471945d40645c7"></a><br></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> Decode functions and callback prototypes. <p> <hr><h2>Typedef Documentation</h2> <a class="anchor" name="bc40e3343ebff3d1418835569079b2c8"></a><!-- doxytag: member="decode.h::FishSoundDecoded_Float" ref="bc40e3343ebff3d1418835569079b2c8" args=")(FishSound *fsound, float *pcm[], long frames, void *user_data)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">typedef int(* <a class="el" href="decode_8h.html#bc40e3343ebff3d1418835569079b2c8">FishSoundDecoded_Float</a>)(<a class="el" href="fishsound_8h.html#8cfb7dfb102ad1af9ff35046aed3ccd9">FishSound</a> *fsound, float *pcm[], long frames, void *user_data) </td> </tr> </table> </div> <div class="memdoc"> <p> Signature of a callback for libfishsound to call when it has decoded PCM audio data, and you want this provided as non-interleaved floats. <p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>fsound</em> </td><td>The FishSound* handle </td></tr> <tr><td valign="top"></td><td valign="top"><em>pcm</em> </td><td>The decoded audio </td></tr> <tr><td valign="top"></td><td valign="top"><em>frames</em> </td><td>The count of frames decoded </td></tr> <tr><td valign="top"></td><td valign="top"><em>user_data</em> </td><td>Arbitrary user data </td></tr> </table> </dl> <dl compact><dt><b>Return values:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>FISH_SOUND_CONTINUE</em> </td><td>Continue decoding </td></tr> <tr><td valign="top"></td><td valign="top"><em>FISH_SOUND_STOP_OK</em> </td><td>Stop decoding immediately and return control to the <a class="el" href="decode_8h.html#070a1843d6990a00e2471945d40645c7" title="Decode a block of compressed data.">fish_sound_decode()</a> caller </td></tr> <tr><td valign="top"></td><td valign="top"><em>FISH_SOUND_STOP_ERR</em> </td><td>Stop decoding immediately, purge buffered data, and return control to the <a class="el" href="decode_8h.html#070a1843d6990a00e2471945d40645c7" title="Decode a block of compressed data.">fish_sound_decode()</a> caller </td></tr> </table> </dl> </div> </div><p> <a class="anchor" name="8ba661947284a888e24f7e5d0b076828"></a><!-- doxytag: member="decode.h::FishSoundDecoded_FloatIlv" ref="8ba661947284a888e24f7e5d0b076828" args=")(FishSound *fsound, float **pcm, long frames, void *user_data)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">typedef int(* <a class="el" href="decode_8h.html#8ba661947284a888e24f7e5d0b076828">FishSoundDecoded_FloatIlv</a>)(<a class="el" href="fishsound_8h.html#8cfb7dfb102ad1af9ff35046aed3ccd9">FishSound</a> *fsound, float **pcm, long frames, void *user_data) </td> </tr> </table> </div> <div class="memdoc"> <p> Signature of a callback for libfishsound to call when it has decoded PCM audio data, and you want this provided as interleaved floats. <p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>fsound</em> </td><td>The FishSound* handle </td></tr> <tr><td valign="top"></td><td valign="top"><em>pcm</em> </td><td>The decoded audio </td></tr> <tr><td valign="top"></td><td valign="top"><em>frames</em> </td><td>The count of frames decoded </td></tr> <tr><td valign="top"></td><td valign="top"><em>user_data</em> </td><td>Arbitrary user data </td></tr> </table> </dl> <dl compact><dt><b>Return values:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>FISH_SOUND_CONTINUE</em> </td><td>Continue decoding </td></tr> <tr><td valign="top"></td><td valign="top"><em>FISH_SOUND_STOP_OK</em> </td><td>Stop decoding immediately and return control to the <a class="el" href="decode_8h.html#070a1843d6990a00e2471945d40645c7" title="Decode a block of compressed data.">fish_sound_decode()</a> caller </td></tr> <tr><td valign="top"></td><td valign="top"><em>FISH_SOUND_STOP_ERR</em> </td><td>Stop decoding immediately, purge buffered data, and return control to the <a class="el" href="decode_8h.html#070a1843d6990a00e2471945d40645c7" title="Decode a block of compressed data.">fish_sound_decode()</a> caller </td></tr> </table> </dl> </div> </div><p> <hr><h2>Function Documentation</h2> <a class="anchor" name="070a1843d6990a00e2471945d40645c7"></a><!-- doxytag: member="decode.h::fish_sound_decode" ref="070a1843d6990a00e2471945d40645c7" args="(FishSound *fsound, unsigned char *buf, long bytes)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">long fish_sound_decode </td> <td>(</td> <td class="paramtype"><a class="el" href="fishsound_8h.html#8cfb7dfb102ad1af9ff35046aed3ccd9">FishSound</a> * </td> <td class="paramname"> <em>fsound</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">unsigned char * </td> <td class="paramname"> <em>buf</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">long </td> <td class="paramname"> <em>bytes</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p> Decode a block of compressed data. <p> No internal buffering is done, so a complete compressed audio packet must be passed each time. <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>fsound</em> </td><td>A FishSound* handle (created with mode FISH_SOUND_DECODE) </td></tr> <tr><td valign="top"></td><td valign="top"><em>buf</em> </td><td>A buffer containing a compressed audio packet </td></tr> <tr><td valign="top"></td><td valign="top"><em>bytes</em> </td><td>A count of bytes to decode (i.e. the length of buf) </td></tr> </table> </dl> <dl class="return" compact><dt><b>Returns:</b></dt><dd>The number of bytes consumed </dd></dl> <dl compact><dt><b>Return values:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>FISH_SOUND_ERR_STOP_OK</em> </td><td>Decoding was stopped by a FishSoundDecode* callback returning FISH_SOUND_STOP_OK before any input bytes were consumed. This will occur when PCM is decoded from previously buffered input, and stopping is immediately requested. </td></tr> <tr><td valign="top"></td><td valign="top"><em>FISH_SOUND_ERR_STOP_ERR</em> </td><td>Decoding was stopped by a FishSoundDecode* callback returning FISH_SOUND_STOP_ERR before any input bytes were consumed. This will occur when PCM is decoded from previously buffered input, and stopping is immediately requested. </td></tr> <tr><td valign="top"></td><td valign="top"><em>FISH_SOUND_ERR_BAD</em> </td><td>Not a valid FishSound* handle </td></tr> <tr><td valign="top"></td><td valign="top"><em>FISH_SOUND_ERR_OUT_OF_MEMORY</em> </td><td>Out of memory </td></tr> </table> </dl> </div> </div><p> <a class="anchor" name="e821800e11efe106676d7ce4c743328a"></a><!-- doxytag: member="decode.h::fish_sound_set_decoded_float" ref="e821800e11efe106676d7ce4c743328a" args="(FishSound *fsound, FishSoundDecoded_Float decoded, void *user_data)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int fish_sound_set_decoded_float </td> <td>(</td> <td class="paramtype"><a class="el" href="fishsound_8h.html#8cfb7dfb102ad1af9ff35046aed3ccd9">FishSound</a> * </td> <td class="paramname"> <em>fsound</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="decode_8h.html#bc40e3343ebff3d1418835569079b2c8">FishSoundDecoded_Float</a> </td> <td class="paramname"> <em>decoded</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">void * </td> <td class="paramname"> <em>user_data</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p> Set the callback for libfishsound to call when it has a block of decoded PCM audio ready, and you want this provided as non-interleaved floats. <p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>fsound</em> </td><td>A FishSound* handle (created with mode FISH_SOUND_DECODE) </td></tr> <tr><td valign="top"></td><td valign="top"><em>decoded</em> </td><td>The callback to call </td></tr> <tr><td valign="top"></td><td valign="top"><em>user_data</em> </td><td>Arbitrary user data to pass to the callback </td></tr> </table> </dl> <dl compact><dt><b>Return values:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>0</em> </td><td>Success </td></tr> <tr><td valign="top"></td><td valign="top"><em>FISH_SOUND_ERR_BAD</em> </td><td>Not a valid FishSound* handle </td></tr> <tr><td valign="top"></td><td valign="top"><em>FISH_SOUND_ERR_OUT_OF_MEMORY</em> </td><td>Out of memory </td></tr> </table> </dl> </div> </div><p> <a class="anchor" name="3a4055f579b841a5c05d2a2865f5e939"></a><!-- doxytag: member="decode.h::fish_sound_set_decoded_float_ilv" ref="3a4055f579b841a5c05d2a2865f5e939" args="(FishSound *fsound, FishSoundDecoded_FloatIlv decoded, void *user_data)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int fish_sound_set_decoded_float_ilv </td> <td>(</td> <td class="paramtype"><a class="el" href="fishsound_8h.html#8cfb7dfb102ad1af9ff35046aed3ccd9">FishSound</a> * </td> <td class="paramname"> <em>fsound</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="decode_8h.html#8ba661947284a888e24f7e5d0b076828">FishSoundDecoded_FloatIlv</a> </td> <td class="paramname"> <em>decoded</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">void * </td> <td class="paramname"> <em>user_data</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p> Set the callback for libfishsound to call when it has a block of decoded PCM audio ready, and you want this provided as interleaved floats. <p> <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>fsound</em> </td><td>A FishSound* handle (created with mode FISH_SOUND_DECODE) </td></tr> <tr><td valign="top"></td><td valign="top"><em>decoded</em> </td><td>The callback to call </td></tr> <tr><td valign="top"></td><td valign="top"><em>user_data</em> </td><td>Arbitrary user data to pass to the callback </td></tr> </table> </dl> <dl compact><dt><b>Return values:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>0</em> </td><td>Success </td></tr> <tr><td valign="top"></td><td valign="top"><em>FISH_SOUND_ERR_BAD</em> </td><td>Not a valid FishSound* handle </td></tr> <tr><td valign="top"></td><td valign="top"><em>FISH_SOUND_ERR_OUT_OF_MEMORY</em> </td><td>Out of memory </td></tr> </table> </dl> </div> </div><p> </div> <hr size="1"><address style="text-align: right;"><small>Generated on Wed Feb 3 22:16:44 2010 for libfishsound by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> </body> </html>