code: def pitch_shifter(self, chunk, shift):
          
          freq = numpy.fft.rfft(chunk)
  
          N = len(freq)
          shifted_freq = numpy.zeros(N, freq.dtype)
  
          S = numpy.round(shift if shift > 0 else N + shift, 0)
          s = N - S
  
          shifted_freq[:S] = freq[s:]
          shifted_freq[S:] = freq[:s]
  
          shifted_chunk = numpy.fft.irfft(shifted_freq)
  
          return shifted_chunk.astype(chunk.dtype)
docs: Pitch-Shift the given chunk by shift semi-tones.