pyrubberband.pyrb.time_stretch

pyrubberband.pyrb.time_stretch(y, sr, rate, rbargs=None)[source]

Apply a time stretch of rate to an audio time series.

This uses the tempo form for rubberband, so the higher the rate, the faster the playback.

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

Audio time series, either single or multichannel

sr : int > 0

Sampling rate of y

rate : float > 0

Desired playback rate.

rbargs

Additional keyword parameters for rubberband

See rubberband -h for details.

Returns:
y_stretch : np.ndarray

Time-stretched audio

Raises:
ValueError

if rate <= 0