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=utf-8" /> 5<meta http-equiv="Content-Style-Type" content="text/css" /> 6<title>DSP_PlaySound</title> 7<link rel="stylesheet" href="../../css/nitro.css" type="text/css" /> 8</head> 9<body> 10 11<h1>DSP_PlaySound <IMG src="../../image/TWL.gif" align="middle"></H1> 12<H2>Syntax</H2> 13 14<pre><code> 15void DSP_PlaySound(const void *src, u32 len, BOOL stereo); 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">src</SPAN></td> 23<td style="width:87%">The original sampling data. <br />Only 16-bit PCM data can be specified, and its sampling rate must match the I2S operating frequency obtained from the <a href="../../snd/sndex/SNDEX_GetI2SFrequency.html"><CODE>SNDEX_GetI2SFrequency</CODE></a> function.<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">len</SPAN></td> 27<td style="width:87%">Byte size of the sampling data.</td> 28</tr> 29<tr> 30<td style="width:13%"><SPAN class="argument">stereo</SPAN></td> 31<td style="width:87%"><CODE>TRUE</CODE> for stereo and <CODE>FALSE</CODE> for monaural.</td> 32</tr> 33</tbody> 34</table> 35 36<h2>Return Values</h2> 37<p>None.</p> 38 39<h2>Description</h2> 40<p>Plays an arbitrary sound from the DSP. If you call this function while playing another sound, the DSP stops the prior sound and plays the new sound. However, if you call it while <a href="DSP_PlayShutterSound.html"><CODE>DSP_PlayShutterSound</CODE></a> is playing the shutter sound, it will be ignored. This function can be used if any of the DSP components have been loaded. 41</p> 42 43<h2>Note</h2> 44<ul> 45<li><span style='color:Red'>The specified buffers must all satisfy the same conditions as 16-bit DMA transfers.</span> 46<ul> 47<li>Addresses must be 16-bit aligned.</li> 48<li>The buffer content must be cached in advance.</li> 49</ul> 50</li> 51</ul> 52 53<h2>See Also</h2> 54<p><a href="DSP_IsSoundPlaying.html"><CODE>DSP_IsSoundPlaying</CODE></a><BR> <a href="../g711/DSP_LoadG711.html"><CODE>DSP_LoadG711</CODE></a></p> 55 56<h2>Revision History</h2> 57<p> 582009/09/02 Deleted a note stating that this cannot be used together with other component features. <br>2009/07/16 Added an explanation about using this together with other component features. <br>2008/09/25 Mentioned that sound output is controlled exclusively. <br />2008/07/09 Changed the units of the size accepted as an argument from half-words to bytes. <BR>2008/05/27 Added a note on sampling data conditions. <br />2008/04/22 Initial version. 59</p> 60<hr><p>CONFIDENTIAL</p></body> 61</html> 62