1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html xmlns="http://www.w3.org/1999/xhtml"> 3<head> 4<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" /> 5<meta http-equiv="Content-Style-Type" content="text/css" /> 6<title>DSP_EncodeG711</title> 7<link rel="stylesheet" href="../../css/nitro.css" type="text/css" /> 8</head> 9<body> 10 11<h1>DSP_EncodeG711 <IMG src="../../image/TWL.gif" align="middle"></H1> 12<H2>Syntax</H2> 13 14<pre><code> 15void DSP_EncodeG711(void *dst, const void *src, u32 len, <a href="DSPAudioCodecMode.html">DSPAudioCodecMode</a> mode); 16</code></pre> 17 18<h2>Arguments</h2> 19<table style="width:100%"> 20<tbody> 21<tr> 22<td style="width:13%"><SPAN class="argument">dst</SPAN></td> 23<td style="width:87%">Buffer that will store converted A-law 8-bit or µ-law 8-bit data.<br /><span style='color:Red'>The specified buffer has the same restrictions as a 16-bit DMA transfer. See <B>Note</B> below for more details.</span></td> 24</tr> 25<tr> 26<td style="width:13%"><SPAN class="argument">src</SPAN></td> 27<td style="width:87%">Buffer that holds the 16-bit PCM data to be converted.<br /><span style='color:Red'>The specified buffer has the same restrictions as a 16-bit DMA transfer. See <B>Note</B> below for more details.</span></td> 28</tr> 29<tr> 30<td style="width:13%"><SPAN class="argument">len</SPAN></td> 31<td style="width:87%">Number of samples to convert.</td> 32</tr> 33<tr> 34<td style="width:13%"><SPAN class="argument">mode</SPAN></td> 35<td style="width:87%">Encoding to be converted.<br />Select either <a href="DSPAudioCodecMode.html"><CODE>DSP_AUDIO_CODEC_MODE_G711_ALAW</CODE></a> or <a href="DSPAudioCodecMode.html"><CODE>DSP_AUDIO_CODEC_MODE_G711_ULAW</CODE></a>.</td> 36</tr> 37</tbody> 38</table> 39 40 41<h2>Return Values</h2> 42<p>None.</p> 43 44<h2>Description</h2> 45<p>Encodes PCM samples with the G.711 compression standard. You can use either the <a href="DSP_WaitForG711.html"><CODE>DSP_WaitForG711</CODE></a> or <a href="DSP_TryWaitForG711.html"><CODE>DSP_TryWaitForG711</CODE></a> function to confirm that processing is complete. 46</p> 47 48<h2>Note</h2> 49<ul> 50<li>You must use the <a href="DSP_LoadG711.html"><CODE>DSP_LoadG711</CODE></a> function to load the G.711 component before using this function.</li> 51<li><span style='color:Red'>The buffers specified for the transfer source and destination must all satisfy the same conditions as 16-bit DMA transfers.</span> 52<ul> 53<li>Addresses must be 16-bit aligned.</li> 54<li>Buffers holding the pre-conversion source data to be processed by the DSP must be cached in advance.</li> 55<li>Before the post-conversion buffer obtained from the DSP is accessed, the cache must be invalidated.</li> 56</ul> 57</li> 58</ul> 59 60<h2>See Also</h2> 61<p><a href="DSPAudioCodecMode.html"><CODE>DSPAudioCodecMode</CODE></a> <br /> <a href="DSP_LoadG711.html"><CODE>DSP_LoadG711</CODE></a><BR> <a href="DSP_DecodeG711.html"><CODE>DSP_DecodeG711</CODE></a><BR> <a href="DSP_WaitForG711.html"><CODE>DSP_WaitForG711</CODE></a><BR> <a href="DSP_TryWaitForG711.html"><CODE>DSP_TryWaitForG711</CODE></a></p> 62 63<h2>Revision History</h2> 64<p> 652008/02/21 Initial version. 66</p> 67<hr><p>CONFIDENTIAL</p></body> 68</html> 69