Speech/Music classification of audio files using machine learning techniques.
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import sys
|
|
|
|
from os import listdir
|
|
|
|
from os.path import isfile, join
|
|
|
|
import multiprocessing as mp
|
|
|
|
from feature_extractor import extractFeatures
|
|
|
|
|
|
|
|
audioFiles = [file for file in listdir(sys.argv[1]) if isfile(join(sys.argv[1], file))]
|
|
|
|
|
|
|
|
# Without multithreading
|
|
|
|
# for file in audioFiles:
|
|
|
|
# extractFeatures(sys.argv[1] + file,
|
|
|
|
# sys.argv[2] + file[0:file.rfind('.')] + '.json', int(sys.argv[3]))
|
|
|
|
|
|
|
|
pool = mp.Pool(processes = 8)
|
|
|
|
for file in audioFiles:
|
|
|
|
pool.apply(extractFeatures,args=(sys.argv[1] + file,
|
|
|
|
sys.argv[2] + file[0:file.rfind('.')] + '.json',int(sys.argv[3])))
|
|
|
|
|
|
|
|
print('Batch feature extraction finished successfully.')
|