PitchShiftEffect
CustomAudioEffect that shifts the pitch up (or down) keeping the output buffer exactly the same size as the input, so it never breaks the audio pipeline. With pitch> 1 you get the typical "chipmunk"/squirrel voice.
Unlike a plain resample (which would change the number of samples and therefore the buffer size), this is a time-domain pitch shifter: a delay line whose read position drifts against the write position at the pitch ratio. Two read taps offset by half the window are Hann-crossfaded so the wrap-around is inaudible (the two Hann windows offset by half a period sum to 1 → constant amplitude). Because it produces one output sample per input sample, the length is preserved.
Expects 16 bit little endian PCM (the format the microphone delivers). It is designed for mono; interleaved stereo still sounds fine but bleeds slightly between channels at the tap boundary.