Commit ff47955c authored by David Pollack's avatar David Pollack
Browse files

change to downsample in VCTK

parent 3433b9b6
......@@ -36,9 +36,9 @@ def read_audio(fp, downsample=True):
if downsample:
# 48khz -> 16 khz
if sig.size(0) % 3 == 0:
sig = sig.view(3, -1, sig.size(1)).mean(0)
sig = sig[::3].contiguous()
else:
sig = sig[:-(sig.size(0) % 3)].view(3, -1, sig.size(1)).mean(0)
sig = sig[:-(sig.size(0) % 3):3].contiguous()
return sig, sr
def load_txts(dir):
......
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