本文整理汇总了Python中Analyzer.Analyzer.process_mp3方法的典型用法代码示例。如果您正苦于以下问题:Python Analyzer.process_mp3方法的具体用法?Python Analyzer.process_mp3怎么用?Python Analyzer.process_mp3使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Analyzer.Analyzer
的用法示例。
在下文中一共展示了Analyzer.process_mp3方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: mp3_to_feature_vectors
# 需要导入模块: from Analyzer import Analyzer [as 别名]
# 或者: from Analyzer.Analyzer import process_mp3 [as 别名]
def mp3_to_feature_vectors(self):
#checks for and removes existing feature vector files
os.chdir(outputpath)
fileList = glob.glob("*.csv")
for f in fileList:
os.remove(f)
#new generic Analyzer and dataflow
theanalyzer = Analyzer(self.SAMPLERATE, self.featureList, True)
df = theanalyzer.dataFlowCreator()
failed_mp3 = []
failed_dir = []
i = 0
for path in self.mp3dirs:
logging.info("Changed path: %s"%(path))
for dirpath, dirnames, filenames in os.walk(path):
for filename in [f for f in filenames if f.endswith(".mp3")]:
os.chdir(dirpath)
if theanalyzer.process_mp3(filename, df) == False:
failed_mp3.append(filename)
i += 1
os.chdir(syspath)
print "wrote %d files." % i