1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3 4<head> 5<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 6<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 6.5.0.0 for Windows"> 7<META http-equiv="Content-Style-Type" content="text/css"> 8<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css"> 9<title>THPAudioDecode</title> 10</head> 11 12<body> 13 14<h1>THPAudioDecode</h1> 15 16<h2>C Specification</h2> 17 18<dl> 19<dd><pre><code>#include <revolution/tpl.h></code></pre> 20 </dd> 21<dd><pre><CODE>u32 THPAudioDecode(s16 *buffer, u8 *audioFrame, s32 flag);</CODE></pre> 22 </dd> 23</dl> 24 25<h2>Arguments</h2> 26<table border="1" cellpadding="3" cellspacing="0.1"> 27 <tr> 28<td width="120" bgcolor="#ffffe8"><strong><FONT face="Courier New"><em>buffer</em></FONT></strong></td> 29<td width="520">Pointer to a buffer that stores extracted audio data.</td> 30 </tr> 31 <tr> 32<td width="120" bgcolor="#ffffe8"><strong><em><FONT face="Courier New">audioFrame</FONT></em></strong></td> 33<td width="520">Pointer to the THP audio data.</td> 34 </tr> 35 <tr> 36<td width="120" bgcolor="#ffffe8"><strong><em><FONT face="Courier New">flag</FONT></em></strong></td> 37<td width="520">Specifies the order of expanded audio data. </td> 38 </tr> 39</table> 40 41<h2>Return Values</h2> 42<p>Returns the number of decoded stereo samples. (Each sample of a left/right channel pair increments the count by one.) </p> 43 44<H2>Description</H2> 45<p>This function expands the THP audio data specified by the second argument and outputs the THP audio data to the buffer specified by the first argument. The format of the output data is specified by the third argument. </p> 46 47<p>The output of the <code>THPAudioDecode</code>fuction becomes stereo format. This function converts THP audio data that is input in mono format into stereo format for output. This function also returns the number of decoded stereo samples for a return value. (Each sample of a left/right channel pair increments the count by one.) </p> 48 49<p><STRONG><EM><CODE>flag</CODE></EM></STRONG> specifies <CODE>THP_AUDIO_INTERLEAVE</CODE> or <CODE>THP_AUDIO_NO_INTERLEAVE</CODE>. If <CODE>THP_AUDIO_INTERLEAVE</CODE> is specified, this function interleaves the extracted data of the left/right channel pair per sample, and then outputs the data to the specified buffer. Based on the audio interface specifications for the Revolution, the interleave order is [ right, left, right, left, ... ]. If <CODE>THP_AUDIO_NO_INTERLEAVE</CODE> is specified, this function groups the expanded data of the left/right channel data by channel, and then outputs the data to the specified buffer. The output order is all samples for the right channel, and then all samples for the left channel..</p> 50 51<p><strong> 52Note:</STRONG> 53Even if the specified THP audio data is mono, regardless of the specified third argument, this function converts the expanded data into stereo format. The output buffer specified by the first argument should be the same size as the audio data in stereo format.</strong></p> 54 55<p><strong>Note: The <code>THPAudioDecode</code> function does not use locked cache.</strong></p> 56 57<H2>See Also</H2> 58 59<H2>Revision History</H2> 60<P>03/01/2006 Initial version.</P> 61 62</body> 63</html> 64