File size: 476 Bytes
072e103
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/usr/bin/env python3

import os
import shutil
import os
from pathlib import Path


IN="./raw"
OUT="./raw_good"


GOOD = None
with open('./good.txt', 'r') as f:
    GOOD = list(map(str.strip, f.readlines()))

wav_files = []
for root, _, files in os.walk(IN):
    for file in files:
        if not (file.endswith('.wav') and file[:-4] in GOOD): continue
        src = Path(os.path.join(root, file))
        dst_name = Path(OUT) / src.name
        shutil.move(src, dst_name)