withSdk

Overview

Demonstrates the joint use of nw::snd and nn::snd.

How to Use

Description

Joint use of nw::snd and nn::snd requires the programmer to consider the timing of various operations to nn::snd::Voice obtained independently by the user.

This demo shows an example of performing operations to nn::snd::Voice, obtained independently, inside the callback function registered using the nw::snd::SoundSystem::SetSoundFrameUserCallback function.

      void MySoundFrameProcess( uptr )
      {
          if ( s_pVoice )
          {
              nn::snd::MixParam mix;
              PanToMixParam( mix, s_SdkVoicePan );
              s_pVoice->SetMixParam( mix );

              if ( s_SdkVoicePauseTrigger )
              {
                  nn::snd::Voice::State state =
                      s_IsSdkVoicePause ? nn::snd::Voice::STATE_PAUSE : nn::snd::Voice::STATE_PLAY;
                  s_pVoice->SetState( state );
                  s_SdkVoicePauseTrigger = false;
              }
          }
      }

      // Add a process for processing nw::snd sound frames
      nw::snd::SoundSystem::SetSoundFrameUserCallback( MySoundFrameProcess, NULL );
      

For details, see Chapter 7, Notes on Using the nn::snd Library, in the Sound Programmer's Guide.

Revision History

2010/09/27
Initial version.

CONFIDENTIAL