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"> 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>Sound (snd) Sample Demo</title> 8 </head> 9 <body> 10 <h1>withSdk</h1> 11 12 <h2>Overview</h2> 13 <div class="section"> 14 <p> 15 Demonstrates the joint use of <a href="../Overview.html">nw::snd</a> and nn::snd. 16 </p> 17 </div> 18 19 <h2>How to Use</h2> 20 <div class="section"> 21 <p> 22 <ul> 23 <li>A Button: Plays the sequence sound</li> 24 <li>Y Button: Plays the stream sound</li> 25 <li>B Button: Stops the sound</li> 26 </ul> 27 <ul> 28 <li>X Button: Plays/pauses the sine wave (plays automatically after demo startup)</li> 29 <li>L Button: Pans left</li> 30 <li>R Button: Pans right</li> 31 </ul> 32 <ul> 33 <li>START Button: Restart the demo.</li> 34 </ul> 35 <ul> 36 Sine wave playback status and a pan value are displayed in the lower screen. 37 </ul> 38 </p> 39 </div> 40 41 <h2>Description</h2> 42 <div class="section"> 43 <p> 44 Joint use of <a href="../Overview.html">nw::snd</a> and nn::snd requires the programmer to consider the timing of various operations to nn::snd::Voice obtained independently by the user. 45 </p> 46 <p> 47 This demo shows an example of performing operations to nn::snd::Voice, obtained independently, inside the callback function registered using the <a href="../SoundSystem/SetSoundFrameUserCallback.html">nw::snd::SoundSystem::SetSoundFrameUserCallback</a> function. 48 </p> 49 <pre> 50 void MySoundFrameProcess( uptr ) 51 { 52 if ( s_pVoice ) 53 { 54 nn::snd::MixParam mix; 55 PanToMixParam( mix, s_SdkVoicePan ); 56 s_pVoice->SetMixParam( mix ); 57 58 if ( s_SdkVoicePauseTrigger ) 59 { 60 nn::snd::Voice::State state = 61 s_IsSdkVoicePause ? nn::snd::Voice::STATE_PAUSE : nn::snd::Voice::STATE_PLAY; 62 s_pVoice->SetState( state ); 63 s_SdkVoicePauseTrigger = false; 64 } 65 } 66 } 67 68 // Add a process for processing nw::snd sound frames 69 nw::snd::SoundSystem::SetSoundFrameUserCallback( MySoundFrameProcess, NULL ); 70 </pre> 71 <p> 72 For details, see Chapter 7, <I>Notes on Using the nn::snd Library</I>, in the <I>Sound Programmer's Guide</I>. 73 </p> 74 </div> 75 76 <h2>Revision History</h2> 77 <div class="section"> 78 <dl class="history"> 79 <dt>2010/09/27</dt> 80 <dd>Initial version.<br /> 81 </dd> 82 </dl> 83 </div> 84 <hr><p>CONFIDENTIAL</p></body> 85</html> 86 87