-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcreateNoise.py
More file actions
28 lines (19 loc) · 732 Bytes
/
createNoise.py
File metadata and controls
28 lines (19 loc) · 732 Bytes
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
27
28
import csv
from shutil import copyfile
categories = [
'door_wood_knock'
]
noise_files_list = []
with open('/home/ankur/Downloads/Others/ESC-50-master/meta/esc50.csv') as csv_file:
csv_reader = csv.reader(csv_file, delimiter=',')
for row in csv_reader:
category = row[3]
if category in categories:
noise_files_list.append((row[0], category))
raw_folder = '/home/ankur/Downloads/Others/ESC-50-master/audio'
dest_folder = '/home/ankur/Downloads/Others/noise'
for noise_file in noise_files_list:
noise_file_path = raw_folder + '/' + noise_file[0]
dest_file_path = dest_folder + '/' + noise_file[1] + '_' + noise_file[0]
copyfile(noise_file_path, dest_file_path)
print("Done")