1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<HTML>
3<HEAD>
4<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css">
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<TITLE>AX Voice Parameters</TITLE>
9</HEAD>
10
11<BODY>
12
13<H1 align="left">Voice Parameters</H1>
14
15<H2>Overview</H2>
16<p>The following are the operations related to voice parameters. Call the function appropriate to each of these operations.</p>
17<UL>
18<LI>Use the <CODE>AXSetVoice*</CODE> functions to set voice parameters.
19<LI>Voice parameters can also be set directly using the application in the <code>axvpb</code> data structure. This method can save a few CPU cycles. However, you must assert the appropriate synchronization flags in <code>axvpb.sync</code>. Some parameters depend on other parameter settings for proper operation.
20</UL>
21
22<H2>Examples</H2>
23<p>The following are code examples.</p>
24<BLOCKQUOTE>
25<PRE><code>#include &lt;revolution.h&gt;
26
27#ifdef SET_PARAMS_WITH_AX_API
28
29    AXPBADDR addr;
30
31    addr.loopFlag           = AXPBADDR_LOOP_ON;
32    addr.format             = AX_PB_FORMAT_ADPCM;
33    addr.loopAddressHi      = (u16)(loopAddress &gt;&gt; 16);
34    addr.loopAddressLo      = (u16)(loopAddress &amp; 0xffff);
35    addr.endAddressHi       = (u16)(endAddress &gt;&gt; 16);
36    addr.endAddressLo       = (u16)(endAddress &amp; 0xffff);
37    addr.currentAddressHi   = (u16)(startAddress &gt;&gt; 16);
38    addr.currentAddressLo   = (u16)(startAddress &amp; 0xffff);
39
40    AXSetVoiceAddr(axvpb, &amp;addr);
41
42#else
43
44    int old = OSDisableInterrupts();
45
46    axvpb-&gt;addr.loopFlag           = AXPBADDR_LOOP_ON;
47    axvpb-&gt;addr.format             = AX_PB_FORMAT_ADPCM;
48    axvpb-&gt;addr.loopAddressHi      = (u16)(loopAddress &gt;&gt; 16);
49    axvpb-&gt;addr.loopAddressLo      = (u16)(loopAddress &amp; 0xffff);
50    axvpb-&gt;addr.endAddressHi       = (u16)(endAddress &gt;&gt; 16);
51    axvpb-&gt;addr.endAddressLo       = (u16)(endAddress &amp; 0xffff);
52    axvpb-&gt;addr.currentAddressHi   = (u16)(startAddress &gt;&gt; 16);
53    axvpb-&gt;addr.currentAddressLo   = (u16)(startAddress &amp; 0xffff);
54
55    axvpb-&gt;sync |= AX_SYNC_USER_ADDR;
56
57    OSRestoreInterrupts(old);
58
59#endif
60
61// This is only a code example. You must also set the
62// loop context for ADPCM-encoded sounds.</CODE></PRE>
63</BLOCKQUOTE>
64
65<H2>Revision History</H2>
66<P>
672007/10/02 Revised the entire document following changes to the structure of the function reference.<br>2006/03/01 Initial version.<br>
68</P>
69
70<hr><p>CONFIDENTIAL</p></body>
71</HTML>