Skip to content

Commit 1e534ec

Browse files
authored
add return_complex=True to stft
1 parent cf9a707 commit 1e534ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torch_pitch_shift/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def pitch_shift(
149149
resampler = T.Resample(sample_rate, int(sample_rate / shift)).to(input.device)
150150
output = input
151151
output = output.reshape(batch_size * channels, samples)
152-
output = torch.stft(output, n_fft, hop_length)[None, ...]
152+
output = torch.stft(output, n_fft, hop_length, return_complex=True)[None, ...]
153153
stretcher = T.TimeStretch(
154154
fixed_rate=float(1 / shift), n_freq=output.shape[2], hop_length=hop_length
155155
).to(input.device)

0 commit comments

Comments
 (0)