We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ee4177 commit 1305f57Copy full SHA for 1305f57
torch_pitch_shift/main.py
@@ -143,13 +143,13 @@ def pitch_shift(
143
resampler = T.Resample(sample_rate, int(sample_rate / shift)).to(input.device)
144
output = input
145
output = output.reshape(batch_size * channels, samples)
146
- output = resampler(output)
147
output = torch.stft(output, n_fft)[None, ...]
148
stretcher = T.TimeStretch(fixed_rate=float(1 / shift), n_freq=output.shape[2]).to(
149
input.device
150
)
151
output = stretcher(output)
152
output = torch.istft(output[0], n_fft)
+ output = resampler(output)
153
del resampler, stretcher
154
if output.shape[1] >= input.shape[2]:
155
output = output[:, : (input.shape[2])]
0 commit comments