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