From bdfc2aadb15d4354c34a5de36a2cb3c503dd7450 Mon Sep 17 00:00:00 2001 From: Robert Beckebans Date: Fri, 24 May 2013 18:55:56 +0200 Subject: [PATCH] Allow slow-motion sound effect for OpenAL sounds --- neo/sound/OpenAL/AL_SoundVoice.h | 7 +++++++ neo/sound/SoundVoice.h | 10 ++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/neo/sound/OpenAL/AL_SoundVoice.h b/neo/sound/OpenAL/AL_SoundVoice.h index 9fdb1cec..bddd15f4 100644 --- a/neo/sound/OpenAL/AL_SoundVoice.h +++ b/neo/sound/OpenAL/AL_SoundVoice.h @@ -56,6 +56,13 @@ public: alSourcef( openalSource, AL_GAIN, ( gain ) < ( 1.0f ) ? ( gain ) : ( 1.0f ) ); } + void SetPitch( float p ) + { + idSoundVoice_Base::SetPitch( p ); + + alSourcef( openalSource, AL_PITCH, p ); + } + void Create( const idSoundSample* leadinSample, const idSoundSample* loopingSample ); // Start playing at a particular point in the buffer. Does an Update() too diff --git a/neo/sound/SoundVoice.h b/neo/sound/SoundVoice.h index 7963a70b..8708cbb4 100644 --- a/neo/sound/SoundVoice.h +++ b/neo/sound/SoundVoice.h @@ -54,16 +54,18 @@ public: { gain = g; } + + virtual void SetPitch( float p ) + { + pitch = p; + } // RB end void SetCenterChannel( float c ) { centerChannel = c; } - void SetPitch( float p ) - { - pitch = p; - } + void SetInnerRadius( float r ) { innerRadius = r;