pyrubberband.pyrb.pitch_shift

pyrubberband.pyrb.pitch_shift(y, sr, n_steps, rbargs=None)[source]

Apply a pitch shift to an audio time series.

Parameters:
ynp.ndarray [shape=(n,) or (n, c)]

Audio time series, either single or multichannel

srint > 0

Sampling rate of y

n_stepsfloat

Shift by n_steps semitones.

rbargs{key:value, key:value}

Additional keyword parameters for rubberband Accepts a dictionary of key:value pairs supported by rubberband. type(key and value) == str() For single valued rbargs, pass empty string for value. See rubberband -h for details.

Returns:
y_shiftnp.ndarray

Pitch-shifted audio