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>AllocVoice</title> 8 </head> 9 <body> 10 <h1><CODE>nn::snd::CTR::AllocVoice</CODE> Function</h1> 11 <h2>Syntax</h2> 12 <div class="section"> 13 <pre class="definition"> 14<a href="../../../nn/snd/CTR/Voice/Overview.html">Voice</a> * AllocVoice( 15 s32 priority, 16 <a href="../../../nn/snd/CTR/VoiceDropCallbackFunc.html">VoiceDropCallbackFunc</a> callback, 17 uptr userArg 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>priority</th> 34 <td>Priority.</td> 35 </tr> 36 <tr> 37 <td>in</td> 38 <th>callback</th> 39 <td>Address of the callback function.</td> 40 </tr> 41 <tr> 42 <td>in</td> 43 <th>userArg</th> 44 <td>User argument.</td> 45 </tr> </table> 46 </div> 47 <h2>Return Values</h2> 48 <div class="section">Returns the address of a <CODE>Voice</CODE> object on success. Returns <CODE>NULL</CODE> on failure. </div> 49 <h2>Description</h2> 50 <div class="section"> 51 <p>Gets a voice.</p><p> 52 Call this function to get a valid <CODE>Voice</CODE> object. This function returns the address of one usable object of the 24 voice objects managed by the library. If the maximum number of voice objects (24) have already been obtained, behavior depends on the priority specified as an argument. 53 </p><p><table><tr><th>Normal priority</th><td> 54 If the priority specified as an argument is greater than or equal to the lowest priority in the obtained objects, the lowest-priority voice is stopped and the object's address is returned. The callback function specified by <SPAN class="argument">callback</SPAN> is invoked for the voice that is stopped. 55 </td></tr><tr><th><CODE>VOICE_PRIORITY_NODROP</CODE></th><td> 56 If the lowest priority object among the obtained objects is <CODE>VOICE_PRIORITY_NODROP</CODE>, NULL is returned. If the lowest priority is lower than <CODE>VOICE_PRIORITY_NODROP</CODE>, this function behaves as if you specified a normal priority. 57 </td></tr></table></p></div> 58 <h2>Revision History</h2> 59 <div class="section"> 60 <dl class="history"> 61 <dt>2010/07/23</dt> 62 <dd>Fixed a typo related to the maximum number of voices. 63 </dd> 64 <dt>2010/01/29</dt> 65 <dd>Initial version.<br /> 66 </dd> 67 </dl> 68 </div> 69 <hr><p>CONFIDENTIAL</p></body> 70</html>