Commit 4b5db340 authored by Caroline Chen's avatar Caroline Chen
Browse files

Use integer rates in pitch shift resample (#1861)

parent 04e0e2ff
......@@ -1690,7 +1690,7 @@ def pitch_shift(
Args:
waveform (Tensor): The input waveform of shape `(..., time)`.
sample_rate (float): Sample rate of `waveform`.
sample_rate (int): Sample rate of `waveform`.
n_steps (int): The (fractional) steps to shift `waveform`.
bins_per_octave (int, optional): The number of steps per octave (Default: ``12``).
n_fft (int, optional): Size of FFT, creates ``n_fft // 2 + 1`` bins (Default: ``512``).
......@@ -1736,7 +1736,7 @@ def pitch_shift(
win_length=win_length,
window=window,
length=len_stretch)
waveform_shift = resample(waveform_stretch, sample_rate / rate, float(sample_rate))
waveform_shift = resample(waveform_stretch, sample_rate // rate, float(sample_rate))
shift_len = waveform_shift.size()[-1]
if shift_len > ori_len:
waveform_shift = waveform_shift[..., :ori_len]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment