summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--servers/audio/effects/audio_effect_pitch_shift.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/servers/audio/effects/audio_effect_pitch_shift.cpp b/servers/audio/effects/audio_effect_pitch_shift.cpp
index 11c1d44472..ddb17e050a 100644
--- a/servers/audio/effects/audio_effect_pitch_shift.cpp
+++ b/servers/audio/effects/audio_effect_pitch_shift.cpp
@@ -87,8 +87,10 @@ void SMBPitchShift::PitchShift(float pitchShift, long numSampsToProcess, long ff
double magn, phase, tmp, window, real, imag;
double freqPerBin, expct;
long i,k, qpd, index, inFifoLatency, stepSize, fftFrameSize2;
+ unsigned long fftFrameBufferSize;
/* set up some handy variables */
+ fftFrameBufferSize = (unsigned long)fftFrameSize*sizeof(float);
fftFrameSize2 = fftFrameSize/2;
stepSize = fftFrameSize/osamp;
freqPerBin = sampleRate/(double)fftFrameSize;
@@ -160,8 +162,8 @@ void SMBPitchShift::PitchShift(float pitchShift, long numSampsToProcess, long ff
/* ***************** PROCESSING ******************* */
/* this does the actual pitch shifting */
- memset(gSynMagn, 0, fftFrameSize*sizeof(float));
- memset(gSynFreq, 0, fftFrameSize*sizeof(float));
+ memset(gSynMagn, 0, fftFrameBufferSize);
+ memset(gSynFreq, 0, fftFrameBufferSize);
for (k = 0; k <= fftFrameSize2; k++) {
index = k*pitchShift;
if (index <= fftFrameSize2) {
@@ -214,7 +216,7 @@ void SMBPitchShift::PitchShift(float pitchShift, long numSampsToProcess, long ff
}
/* shift accumulator */
- memmove(gOutputAccum, gOutputAccum+stepSize, fftFrameSize*sizeof(float));
+ memmove(gOutputAccum, gOutputAccum+stepSize, fftFrameBufferSize);
/* move input FIFO */
for (k = 0; k < inFifoLatency; k++) { gInFIFO[k] = gInFIFO[k+stepSize];