nn::snd::CTR::Voice::SetState Member Function
void SetState(
State state
);
| Name | Description | |
|---|---|---|
| in | state | State |
Sets the current state of a voice.
If you specify a value of STATE_PLAY, the voice transitions to the "playback instruction received" state (note that this is a playback instruction; the voice is not necessarily played back). If a buffer has been registered through nn::snd::CTR::Voice::AppendWaveBuffer, playback starts immediately. If a sound source buffer has not been registered, nothing happens until one is. Playback starts immediately once a buffer is registered. Once you finish playing all of the sound source buffers, the "playback instruction received" state is maintained but nothing happens.
Voices are played back in descending priority order, so some voices may not be played back depending on the priorities and the processor load.
If you specify a value of STATE_STOP, playback stops. All registered buffers are changed to the "playback complete" state.
If you specify a value of STATE_PAUSE, playback is paused. The buffer state is maintained. To resume playback, call nn::snd::CTR::Voice::SetState with STATE_PLAY as an argument. Playback resumes where it was paused.
The state for the Voice class only changes when it is set by the user. For example, even if playback has ended for a WaveBuffer added by the nn::snd::CTR::Voice::AppendWaveBuffer function, state remains at STATE_PLAY; you can restart playback by appending another WaveBuffer. Use the nn::snd::CTR::Voice::IsPlaying function to determine whether a Voice is actually being played back.
CONFIDENTIAL