"src/vscode:/vscode.git/clone" did not exist on "443aa14e415533031aa8b9761d1808ec68acda1e"
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): ...@@ -36,9 +36,9 @@ def read_audio(fp, downsample=True):
if downsample: if downsample:
# 48khz -> 16 khz # 48khz -> 16 khz
if sig.size(0) % 3 == 0: if sig.size(0) % 3 == 0:
sig = sig.view(3, -1, sig.size(1)).mean(0) sig = sig[::3].contiguous()
else: 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 return sig, sr
def load_txts(dir): 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