Mercurial > hg > chourdakisreiss2016
view experiment-reverb/code/segmentation.py @ 0:246d5546657c
initial commit, needs cleanup
author | Emmanouil Theofanis Chourdakis <e.t.chourdakis@qmul.ac.uk> |
---|---|
date | Wed, 14 Dec 2016 13:15:48 +0000 |
parents | |
children |
line wrap: on
line source
#!/bin/env python2 print("Loading libraries") from essentia.streaming import * from os import listdir from os.path import isdir, isfile print("done") songdirs = [] WINDOWSIZE = 1024 HOPSIZE = WINDOWSIZE/2 for fullsong in listdir('fullsongs'): if isdir('fullsongs/%s' % fullsong): print("%s is a directory, diving in." % fullsong) for file in listdir('fullsongs/%s' % fullsong): if isfile('fullsongs/%s/%s' % (fullsong, file)) and file[-3:].lower() == 'wav': fullpath = "fullsongs/%s/%s" % (fullsong,file) print(fullpath) loader = MonoLoader(filename = fullpath) frameCutter = FrameCutter(frameSize = WINDOWSIZE, hopSize = HOPSIZE) windower = Windowing(size = WINDOWSIZE) loader.audio >> frameCutter.signal frameCutter.frame >> windower.frame windower.frame >> None essentia.run(loader)