tyiannak / pyAudioAnalysis

Python Audio Analysis Library: Feature Extraction, Classification, Segmentation and Applications
Apache License 2.0
5.83k stars 1.19k forks source link

time.clock() - AttributeError when training a classification model #316

Closed i-bond closed 4 years ago

i-bond commented 4 years ago

Hello! I'm facing an "AttributeError: module 'time' has no attribute 'clock'" when I attempted to run the classification function provided in the example:

from pyAudioAnalysis import audioTrainTest as aT
aT.extract_features_and_train(["classifierData/music","classifierData/speech"], 1.0, 1.0, aT.shortTermWindow, aT.shortTermStep, "svm", "svmSMtemp", False)
aT.file_classification("data/doremi.wav", "svmSMtemp","svm")

Could you help me to figure out how to fix this error?

i-bond commented 4 years ago

Just change time.clock() to time.time() for t1 andt2 in MidTermFeatures.py if you come across the same issue and evetything should work fine.