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/SoundArchivePlayer/Overview.html">SoundArchivePlayer</a>::Initialize</CODE> Member Function</h1> 11 <h2>Syntax</h2> 12 <div class="section"> 13 <pre class="definition">#include <nw/snd/snd_SoundArchivePlayer.h> 14bool Initialize( 15 const <a href="../../../nw/snd/SoundArchive/Overview.html">SoundArchive</a>* arc, 16 const <a href="../../../nw/snd/SoundDataManager/Overview.html">SoundDataManager</a> * manager, 17 void *buffer, 18 <span>u32</span> size, 19 void* strmBuffer, 20 <span>u32</span> strmBufferSize 21); 22</pre> 23 </div> 24 <h2>Arguments</h2> 25 <div class="section"> 26 <table class="arguments"> 27 <thead> 28 <tr> 29 <td width="15" /> 30 <th>Name</th> 31 <td>Description</td> 32 </tr> 33 </thead> 34 <tr> 35 <td>in</td> 36 <th>arc</th> 37 <td>Sound archive used by the player.</td> 38 </tr> 39 <tr> 40 <td>in</td> 41 <th>manager</th> 42 <td>Sound data manager used by the player.</td> 43 </tr> 44 <tr> 45 <td>in</td> 46 <th>buffer</th> 47 <td>Pointer to the buffer. Must have 32-byte alignment.</td> 48 </tr> 49 <tr> 50 <td>in</td> 51 <th><CODE>size</CODE></th> 52 <td>Buffer size.</td> 53 </tr> 54 <tr> 55 <td>in</td> 56 <th>strmBuffer</th> 57 <td>Pointer to the stream buffer. You must specify 32-byte aligned device memory.</td> 58 </tr> 59 <tr> 60 <td>in</td> 61 <th>strmBufferSize</th> 62 <td>The size of the stream buffer.</td> 63 </tr> </table> 64 </div> 65 <h2>Return Values</h2> 66 <div class="section">Returns true if initialization was successful and false otherwise. </div> 67 <h2>Description</h2> 68 <div class="section"> 69 <p>Initializes a sound archive player.</p><p>Sound archive players must be initialized before they are used. Initializing the sound archive player associates it with a sound archive and sound data manager; this makes the data in the sound archive playable.</p><p>You can get the memory size required by the sound archive player using <span><span>GetRequiredMemSize</span></span> and <span><span>GetRequiredStreamBufferSize</span></span>.</p><p>If the required stream buffer size is 0, you can pass NULL to <span>strmBuffer</span>, the pointer to the stream buffer.</p><p>If the stream buffer is configured to be larger than the size obtained with <span><span>GetRequiredStreamBufferSize</span></span>, it becomes more difficult for stream sounds to stutter. However, there will be a longer delay between when data is loaded and when it is actually played back.</p><p>A device memory address must be specified for the stream buffer. Execution stops on an assert, or false is returned, if the addresses given by strmBuffer and strmBuffer + strmBufferSize do not exist in device memory. (Behavior differs depending on the build target.)</p></div> 70 <h2>See Also</h2> 71 <div class="section"> 72 <p class="reference"><a href="../../../nw/snd/SoundArchivePlayer/GetRequiredMemSize.html">GetRequiredMemSize</a><br /><a href="../../../nw/snd/SoundArchivePlayer/GetRequiredStreamBufferSize.html">GetRequiredStreamBufferSize</a><br /><a href="../../../nw/snd/SoundArchivePlayer/Finalize.html">Finalize</a><br /><a href="../../../nw/snd/SoundArchivePlayer/IsAvailable.html">IsAvailable</a><br /> </p> 73 </div> 74 <h2>Revision History</h2> 75 <div class="section"> 76 <dl class="history"> 77 <dt>2010/03/05</dt> 78 <dd>Added what happens when the stream buffer does not exist in device memory.<br /> 79 </dd> 80 <dt>2010/02/03</dt> 81 <dd>Changed the buffer alignment (from 4 to 32)<br /> 82 </dd> 83 <dt>2010/02/01</dt> 84 <dd>Changed the function name <CODE>Setup</CODE> to <CODE>Initialize</CODE>.<br /> 85 </dd> 86 <dt>2010/01/15</dt> 87 <dd>Initial version.<br /> 88 </dd> 89 </dl> 90 </div> 91 <hr><p>CONFIDENTIAL</p></body> 92</html> 93