Miles Sound System SDK 7.2a

RAD_IOPSetSPUVoicePitch

The function RAD_IOPSetSPUVoicePitch sets the pitch for one or more SPU voices.

S32 RAD_IOPSetSPUVoicePitch(
  U32 core0_voice_mask,
  U32 core1_voice_mask,
  U32 pitch
);

In Parameters

core0_voice_mask
Specifies the bit mask of the voices on core 0 to set.
core1_voice_mask
Specifies the bit mask of the voices on core 1 to set.
pitch
Specifies the pitch to use.

Returns

Returns non-zero on success, or zero on failure.

Discussion

This function tells the SPU to set the pitch of one or more SPU voices.

Pitch is not the same as the frequency or playback rate of the sound. Pitch here is defined as "( freq * 4096 ) / 48000". So, to set a playback rate of 22050, you would use 22050 * 4096 / 48000, or 1882.

The best way to pause a playing SPU voice is to set its pitch to 0. This effectively pauses the sound playback position until you resume it by setting the original pitch again.


Group: The RAD_IOP SPU Hardware Voice API for the Sony PS2
Related Basic Types: S32, U32

For technical support, e-mail Miles3@radgametools.com
© Copyright 1991-2007 RAD Game Tools, Inc. All Rights Reserved.