1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css">
6<title>AXInitSpecifyMem</title>
7<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
8<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 6.5.0.0 for Windows">
9<META http-equiv="Content-Style-Type" content="text/css">
10</head>
11
12<body>
13
14<h1 align="left">AXInitSpecifyMem</h1>
15
16<h2>Syntax</h2>
17<dl><dd><pre class="construction">
18#include &lt;revolution/ax.h&gt;
19
20void AXInitSpecifyMem(u32 num, void* mem);
21</pre></dd></dl>
22
23<h2>Arguments</h2>
24<TABLE class="arguments" border="1" >
25  <tr>
26<TH>num</TH>
27<td>Maximum voice count.</td>
28  </tr>
29  <tr>
30<TH>mem</TH>
31<td>User-allocated memory area for the AX library.</td>
32  </tr>
33</table>
34
35<h2>Return Values</h2>
36<p>None.</p>
37
38<h2>Description</h2>
39<p>The <code>AXInitSpecifyMem</code> function expands the <a href="AXInit.html"><code>AXInit</code></a> function to allow specification of maximum voice count and library memory area.</p>
40
41<p>The <SPAN class="argument">num</SPAN> argument specifies maximum voice count. The upper limit of voice count is <code>AX_MAX_VOICES</code>.</p>
42
43<p>User-allocated AX library memory will be specified to the <SPAN class="argument">mem</SPAN> argument. Memory size is obtained using the <a href="AXGetMemorySize.html"><code>AXGetMemorySize</code></a> macro. Top address of the memory has to be 32-byte aligned.</p>
44
45<p>To control a voice, AX library needs the <code>AXPB</code>, <code>AXVPB</code>, and <code>AXPBITDBUFFER</code> structures for each voice. AX library has the <code>AX_MAX_VOICES</code> count of each structure, which is defined as <code>static</code>.</p>
46
47<p>If <a href="AXInit.html"><code>AXInit</code></a> is used for the AX library initialization, the above structures defined in the library are used for controlling voices.</p>
48
49<p>Alternately, if this function is used in place of <a href="AXInit.html"><code>AXInit</code></a>, the structures allocated to the area specified by <SPAN class="argument">mem</SPAN> will be used for the control. Here, the linkers for the structures defined within the library will not link; unnecessary structures will not consume extra memory.</p>
50
51<p>Use this function to make the maximum voice count smaller than <code>AX_MAX_VOICES</code>, or to allocate voice control structures to a memory of choice between MEM1 and MEM2.</p>
52
53<p><strong>Note: Generally, MEM2 has a slower access speed than MEM1. Compared to MEM1, placing the voice control structures on MEM2 will decrease the number of simultaneous playback voices. In addition, the DSP load estimate of AX assumes that the structures are placed in MEM1. Their placement in MEM2 will make the actual DSP processing time longer than the AX-estimate time, resulting in possible noise in the playback. When placing voice control structures in MEM2, use the <a href="../Debug/AXRegisterExceedCallback.html"><code>AXRegisterExceedCallback</code></a> function to adjust the maximum voice count to prevent noise.</strong></p>
54
55<h2>See Also</h2>
56<p class="reference">
57<a href="AXInit.html">AXInit</a>, <a href="AXGetMemorySize.html">AXGetMemorySize</a>, <a href="../Debug/AXRegisterExceedCallback.html">AXRegisterExceedCallback</a>
58</p>
59
60<H2>Revision History</H2>
61<P>
622006/10/24 Initial version.<br>
63</P>
64
65<hr><p>CONFIDENTIAL</p></body>
66</html>
67