From d46122e60a682790cb1ccfc6058cfff0ff14cfeb Mon Sep 17 00:00:00 2001 From: janwas Date: Fri, 29 Sep 2006 01:04:25 +0000 Subject: [PATCH] # minor fix to sound pitch shift (allowing positive pitch shift) This was SVN commit r4430. --- source/lib/res/sound/snd_mgr.cpp | 6 +++--- source/lib/res/sound/snd_mgr.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/lib/res/sound/snd_mgr.cpp b/source/lib/res/sound/snd_mgr.cpp index a1de6394ef..3948736809 100644 --- a/source/lib/res/sound/snd_mgr.cpp +++ b/source/lib/res/sound/snd_mgr.cpp @@ -2098,15 +2098,15 @@ LibError snd_set_gain(Handle hvs, float gain) * the sound has already been closed (e.g. it never played). * * @param hvs Handle to VSrc - * @param pitch shift: 1.0 means no change; each reduction by 50% equals a - * pitch shift of -12 semitones (one octave). zero is invalid. + * @param pitch shift: 1.0 means no change; each doubling/halving equals a + * pitch shift of +/-12 semitones (one octave). zero is invalid. * @return LibError */ LibError snd_set_pitch(Handle hvs, float pitch) { H_DEREF(hvs, VSrc, vs); - if(!(0.0f < pitch && pitch <= 1.0f)) + if(pitch <= 0.0f) WARN_RETURN(ERR::INVALID_PARAM); vs->pitch = pitch; diff --git a/source/lib/res/sound/snd_mgr.h b/source/lib/res/sound/snd_mgr.h index f864a24ad3..3dcac6351f 100644 --- a/source/lib/res/sound/snd_mgr.h +++ b/source/lib/res/sound/snd_mgr.h @@ -240,8 +240,8 @@ extern LibError snd_set_gain(Handle hs, float gain); * may be called at any time; fails with invalid handle return if * the sound has already been closed (e.g. it never played). * - * @param pitch 1.0 means no change; each reduction by 50% equals a - * pitch shift of -12 semitones (one octave). zero is invalid. + * @param pitch shift: 1.0 means no change; each doubling/halving equals a + * pitch shift of +/-12 semitones (one octave). zero is invalid. * @return LibError **/ extern LibError snd_set_pitch(Handle hs, float pitch);