1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xml:lang="en-US" lang="en-US" 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    <link rel="stylesheet" href="../../../css/manpage.css" type="text/css" />
7    <title>Initialize</title>
8  </head>
9  <body>
10    <h1><CODE><a href="../../../nw/Overview.html">nw</a>::<a href="../../../nw/snd/Overview.html">snd</a>::<a href="../../../nw/snd/SoundSystem/Overview.html">SoundSystem</a>::Initialize</CODE> Member Function</h1>
11    <h2>Syntax</h2>
12    <div class="section">
13      <pre class="definition">#include &lt;nw/snd/snd_SoundSystem.h&gt;
14static void Initialize(
15     const <a href="../../../nw/snd/SoundSystem/SoundSystemParam/Overview.html">SoundSystemParam</a> & param,
16     uptr workMem,
17     size_t workMemSize
18);
19</pre>
20    </div>
21    <h2>Arguments</h2>
22    <div class="section">
23      <table class="arguments">
24        <thead>
25          <tr>
26            <td width="15" />
27            <th>Name</th>
28            <td>Description</td>
29          </tr>
30        </thead>
31        <tr>
32          <td>in</td>
33          <th>param</th>
34          <td>Initialization parameter.</td>
35        </tr>
36        <tr>
37          <td>in</td>
38          <th>workMem</th>
39          <td>Pointer to the sound system work memory.</td>
40        </tr>
41        <tr>
42          <td>in</td>
43          <th>workMemSize</th>
44          <td>The work memory size.</td>
45        </tr> </table>
46    </div>
47    <h2>Return Values</h2>
48    <div class="section">
49                None.
50               </div>
51    <h2>Description</h2>
52    <div class="section">
53      <p>The sound library is initialized.</p><p>The work memory used by the sound system is passed by the user. Set the parameter necessary for initialization to the <a href="../../../nw/snd/SoundSystem/SoundSystemParam/Overview.html"><CODE>SoundSystemParam</CODE></a> structure to obtain the memory size necessary for <a href="../../../nw/snd/SoundSystem/GetRequiredMemSize.html"><CODE>nw::snd::SoundSystem::GetRequiredMemSize</CODE></a>.</p><p>The thread that performs sound operations, along with the thread that loads sound data from the ROM, are initialized and run using the priority and stack size that were specified for the <a href="../../../nw/snd/SoundSystem/SoundSystemParam/Overview.html"><CODE>SoundSystemParam</CODE></a> structure.</p><p>To initialize inside the <a href="../../../nw/snd/Overview.html">nw::snd</a> library without starting a sound thread, call this function with the autoCreateSoundThread member of the <a href="../../../nw/snd/SoundSystem/SoundSystemParam/Overview.html">SoundSystemParam</a> structure set to false. For details, see the demos/snd/createSoundThreadManually demo.</p><p>If a sound thread is not started inside the <a href="../../../nw/snd/Overview.html">nw::snd</a> library, <a href="../../../nw/snd/Overview.html">GetSoundThreadTickCount</a> will not function correctly.</p><p>To make sound threads started in the <a href="../../../nw/snd/Overview.html">nw::snd</a> library run in the system core (Core 1), set the soundThreadCoreNo member of the <a href="../../../nw/snd/SoundSystem/SoundSystemParam/Overview.html">SoundSystemParam</a> structure to 1. For further details, refer to Chapter 8, Running in the System Core, in the Sound Programmer's Guide.</p></div>
54    <h2>See Also</h2>
55    <div class="section">
56      <p class="reference"><a href="../../../nw/snd/SoundSystem/Finalize.html"><CODE>Finalize</CODE></a><br /><a href="../../../nw/snd/SoundSystem/GetRequiredMemSize.html"><CODE>GetRequiredMemSize</CODE></a><br /><a href="../../../nw/snd/SoundSystem/SoundSystemParam/Overview.html"><CODE>SoundSystemParam</CODE></a><br /><a href="../../../nw/snd/SoundSystem/IsInitialized.html"><CODE>IsInitialized</CODE></a><br /> </p>
57    </div>
58    <h2>Revision History</h2>
59    <div class="section">
60      <dl class="history">
61        <dt>2010/09/27</dt>
62        <dd>Added information about running in the system core.<BR>
63        </dd>
64        <dt>2010/06/14</dt>
65        <dd>Added a description of how to initialize without starting a sound thread.<br />
66        </dd>
67        <dt>2010/03/30</dt>
68        <dd>Deleted a note about limitations on the alignment of <CODE>workMem</CODE>.<br />
69        </dd>
70        <dt>2010/01/29</dt>
71        <dd>Changed the function name from <CODE>InitSoundSystem</CODE> to <CODE>Initialize</CODE>, removed the function that only specified the thread priority, and revised the wording.<br />
72        </dd>
73        <dt>2010/01/15</dt>
74        <dd>Initial version.<br />
75        </dd>
76      </dl>
77    </div>
78  <hr><p>CONFIDENTIAL</p></body>
79</html>
80