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>nw::snd::SoundArchivePlayer::Initialize Member Function</h1> 11 <h2>Syntax</h2> 12 <div class="section"> 13 <pre class="definition">#include <nw/snd/snd_SoundArchivePlayer.h> 14 15bool Initialize( 16 const <a href="../../../nw/snd/SoundArchive/Overview.html">SoundArchive</a>* arc, 17 const <a href="../../../nw/snd/SoundDataManager/Overview.html">SoundDataManager</a> * manager, 18 void *buffer, 19 <span>u32</span> size, 20 void* strmBuffer, 21 <span>u32</span> strmBufferSize 22); 23</pre> 24 </div> 25 <h2>Arguments</h2> 26 <div class="section"> 27 <table class="arguments"> 28 <thead> 29 <tr> 30 <td width="15" /> 31 <th>Name</th> 32 <td>Description</td> 33 </tr> 34 </thead> 35 <tr> 36 <td>in</td> 37 <th>arc</th> 38 <td>Sound archive used by the player.</td> 39 </tr> 40 <tr> 41 <td>in</td> 42 <th>manager</th> 43 <td>Sound data manager used by the player.</td> 44 </tr> 45 <tr> 46 <td>in</td> 47 <th>buffer</th> 48 <td>Pointer to the buffer. Must have 32-byte alignment.</td> 49 </tr> 50 <tr> 51 <td>in</td> 52 <th><CODE>size</CODE></th> 53 <td>Buffer size.</td> 54 </tr> 55 <tr> 56 <td>in</td> 57 <th>strmBuffer</th> 58 <td>Pointer to the stream buffer. You must specify 32-byte aligned device memory.</td> 59 </tr> 60 <tr> 61 <td>in</td> 62 <th>strmBufferSize</th> 63 <td>The size of the stream buffer.</td> 64 </tr> </table> 65 </div> 66 <h2>Return Values</h2> 67 <div class="section">Returns true if initialization was successful and false otherwise. </div> 68 <h2>Description</h2> 69 <div class="section"> 70 <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> 71 <h2>See Also</h2> 72 <div class="section"> 73 <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> 74 </div> 75 <h2>Revision History</h2> 76 <div class="section"> 77 <dl class="history"> 78 <dt>2010/03/05</dt> 79 <dd>Added what happens when the stream buffer does not exist in device memory.<br /> 80 </dd> 81 <dt>2010/02/03</dt> 82 <dd>Changed the buffer alignment (from 4 to 32)<br /> 83 </dd> 84 <dt>2010/02/01</dt> 85 <dd>Changed the function name <CODE>Setup</CODE> to <CODE>Initialize</CODE>.<br /> 86 </dd> 87 <dt>2010/01/15</dt> 88 <dd>Initial version.<br /> 89 </dd> 90 </dl> 91 </div> 92 <hr><p>CONFIDENTIAL</p></body> 93</html>