1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html> 2<head> 3<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 4<title>SNDWaveData</title> 5<link rel="stylesheet" href="../css/nitro.css" type="text/css"> 6<meta name="generator" content="DocBook XSL Stylesheets V1.65.1"> 7</head> 8<body> 9<div class="refentry" lang="ja"><a name="IDAKKWT"></a><div class="titlepage"> 10<div></div> 11<div></div> 12</div> 13<h1>SNDWaveData <IMG src="../image/NTR.gif" width="24" height="12" border="0" align=middle><IMG src="../image/TWL.gif" width="24" height="12" border="0" align=middle></h1> 14<h2>Definition</h2> 15<dl> 16<dd><pre class="funcsynopsisinfo"><code>#include <nitro/snd.h></code></pre></dd> 17<dd><pre class="funcsynopsisinfo"><code>typedef struct SNDWaveParam 18{ 19u8 format; 20u8 loopflag; 21u16 rate; 22u16 timer; 23u16 loopstart; 24u32 looplen; 25} SNDWaveParam; 26</code></pre></dd> 27<dd><pre class="funcsynopsisinfo"><code>typedef struct SNDWaveData 28{ 29struct SNDWaveParam param; 30u8 samples[0]; 31} SNDWaveData; 32</code></pre></dd> 33<dd><pre class="funcprototype"></pre></dd> 34</dl> 35<div class="refsection" lang="ja"><a name="IDARLWT"></a> 36<h2>Elements</h2> 37 38 <div class="variablelist"> 39<table border="0"> 40<col align="left" valign="top"> 41<tbody> 42<tr> 43<td><code>format</code></td> 44<td>Sample format.</td> 45</tr> 46<tr> 47<td><code>loopflag</code></td> 48<td>Loop flag. If zero, there is no loop. If non-zero, a loop exists.</td> 49</tr> 50<tr> 51<td><code>rate</code></td> 52<td>Sampling rate. It is expressed in MHz.</td> 53</tr> 54<tr> 55<td><code>timer</code></td> 56<td>Description. It corresponds to SND_TIMER_CLOCK / rate.</td> 57</tr> 58<tr> 59<td><code>loopstart</code></td> 60<td>Starting point of the loop. It is expressed in words (32-bit).</td> 61</tr> 62<tr> 63<td><code>looplen</code></td> 64<td>Length of the loop. If there is no loop, this corresponds to the length of the waveform. It is expressed in words (32-bit).</td> 65</tr> 66<tr> 67<td><code>samples</code></td> 68<td>Array of the sample data. The size of the array, in words, is <CODE>loopstart</CODE> + <CODE>looplen</CODE>. 69 </td> 70</tr> 71</tbody> 72</table> 73</div> 74 </div> 75<div class="refsection" lang="ja"><a name="IDAPNWT"></a> 76<h2>Description</h2> 77 <p> 78Waveform data structure. It holds the header information and the sample data for the waveform data. 79</p> 80 <p> 81The sample format <code>format</code> takes one of the following values. 82</p> 83<div class="table"><a name="IDA0NWT"></a><p class="title"><b><b>Table. SNDWaveFormat</b></b></p> 84<table summary="SNDWaveFormat" border="1"> 85<colgroup><col><col></colgroup> 86<thead> 87<tr> 88<th>Label</th> 89<th>Description</th> 90</tr> 91</thead> 92<tbody> 93<tr> 94<td><code>SND_WAVE_FORMAT_PCM8</code></td> 95<td>8-bit PCM</td> 96</tr> 97<tr> 98<td><code>SND_WAVE_FORMAT_PCM16</code></td> 99<td>16-bit PCM</td> 100</tr> 101<tr> 102<td><code>SND_WAVE_FORMAT_ADPCM</code></td> 103<td>IMA-ADPCM</td> 104</tr> 105</tbody> 106</table> 107</div> 108 <p> 109If the sample format is <code>SND_WAVE_FORMAT_ADPCM</code>, ADPCM header information similar to the following is stored in the first word of the sample data <code>samples</code>. 110</p> 111 <pre class="programlisting"> 112struct { 113s16 prevsample; // Previous sample value 114u8 previndex; // Previous index value 115u8 padding; // Padding (always 0) 116}; 117</pre> 118 119 </div> 120<h2>See Also</h2> 121<p>None.</p> 122<h2>Revision History</h2> 123<p>2005/01/19 Initial version.</p> 124</div> 125<hr><p>CONFIDENTIAL</p></body> 126</html>