Added security check to pitch change #1450
This commit is contained in:
parent
459c4754dc
commit
e6ae4879f6
1 changed files with 1 additions and 1 deletions
|
@ -632,7 +632,7 @@ void SetAudioBufferVolume(AudioBuffer *buffer, float volume)
|
||||||
// Set pitch for an audio buffer
|
// Set pitch for an audio buffer
|
||||||
void SetAudioBufferPitch(AudioBuffer *buffer, float pitch)
|
void SetAudioBufferPitch(AudioBuffer *buffer, float pitch)
|
||||||
{
|
{
|
||||||
if (buffer != NULL)
|
if ((buffer != NULL) && (pitch > 0.0f))
|
||||||
{
|
{
|
||||||
// Pitching is just an adjustment of the sample rate.
|
// Pitching is just an adjustment of the sample rate.
|
||||||
// Note that this changes the duration of the sound:
|
// Note that this changes the duration of the sound:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue