Skip to content

Commit 35b2161

Browse files
committed
- [Psy-X] fix setting SPU pitch=0 not doing anything
1 parent cc9daa6 commit 35b2161

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src_rebuild/PsyCross/src/psx/LIBSPU.C

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,14 @@ void SpuSetVoiceAttr(SpuVoiceAttr *arg)
665665
// update pitch
666666
if (arg->mask & SPU_VOICE_PITCH)
667667
{
668+
ALint state;
669+
alGetSourcei(alSource, AL_SOURCE_STATE, &state);
670+
671+
if (arg->pitch == 0 && state == AL_PLAYING)
672+
alSourcePause(alSource);
673+
else if (voice->attr.pitch == 0 && state == AL_PAUSED)
674+
alSourcePlay(alSource);
675+
668676
voice->attr.pitch = arg->pitch;
669677

670678
pitch = (float)(voice->attr.pitch) / 4096.0f;

0 commit comments

Comments
 (0)