1
0
forked from 0ad/0ad

# minor fix to sound pitch shift

(allowing positive pitch shift)

This was SVN commit r4430.
This commit is contained in:
janwas 2006-09-29 01:04:25 +00:00
parent e001dba9ce
commit d46122e60a
2 changed files with 5 additions and 5 deletions

View File

@ -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;

View File

@ -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);