nn::snd::CTR::Voice::SetPitch Member Function

Syntax

void SetPitch(
     f32 pitch
);

Arguments

Name Description
in pitch Ratio of the playback speed to the sampling rate.

Return Values

None.

Description

Sets the pitch of a voice.

This sets the ratio of the playback speed to the sound source sampling rate set by the nn::snd::CTR::Voice::SetSampleRate function (a ratio of 1.0 indicates that the playback speed and sampling rate are the same). For example, if you specify a sampling rate of 32kHz and a pitch of 0.5, the audio is played at 16kHz.

The maximum value that can be specified for the pitch is 255.0f. The minimum value is 1.0 / (2^23). However, because the processing load increases significantly when a large value is set for the pitch, whether you can actually play sounds accurately depends greatly on the snd usage status.

The default value is 1.0.

Revision History

2012/04/18
Added text about maximum and minimum values.
2010/01/29
Initial version.

CONFIDENTIAL