e@0: #!/bin/env python2 e@0: e@0: e@0: print("Loading libraries") e@0: e@0: from essentia.streaming import * e@0: from os import listdir e@0: from os.path import isdir, isfile e@0: e@0: print("done") e@0: e@0: songdirs = [] e@0: e@0: WINDOWSIZE = 1024 e@0: HOPSIZE = WINDOWSIZE/2 e@0: e@0: for fullsong in listdir('fullsongs'): e@0: if isdir('fullsongs/%s' % fullsong): e@0: print("%s is a directory, diving in." % fullsong) e@0: e@0: for file in listdir('fullsongs/%s' % fullsong): e@0: if isfile('fullsongs/%s/%s' % (fullsong, file)) and file[-3:].lower() == 'wav': e@0: e@0: fullpath = "fullsongs/%s/%s" % (fullsong,file) e@0: print(fullpath) e@0: e@0: loader = MonoLoader(filename = fullpath) e@0: frameCutter = FrameCutter(frameSize = WINDOWSIZE, hopSize = HOPSIZE) e@0: windower = Windowing(size = WINDOWSIZE) e@0: e@0: loader.audio >> frameCutter.signal e@0: frameCutter.frame >> windower.frame e@0: windower.frame >> None e@0: e@0: essentia.run(loader) e@0: e@0: e@0: e@0: