tyiannak / pyAudioAnalysis

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

pyAudioAnalysis Error #176

Open thaingiW opened 6 years ago

thaingiW commented 6 years ago

python /home/lwin/speech-emotion/Speech_emotion_recognition_BLSTM-master1/find_best_model.py -d "berlin" -p /"home/lwin/speech-emotion/Speech_emotion_recognition_BLSTM-master1/wav" -l -e -c 7 Using TensorFlow backend. Writing berlin data set to file... Traceback (most recent call last): File "/home/lwin/speech-emotion/Speech_emotion_recognition_BLSTM-master1/find_best_model.py", line 163, in functions.feature_extract(ds.data, nb_samples=len(ds.targets), dataset=dataset) File "/home/lwin/speech-emotion/Speech_emotion_recognition_BLSTM-master1/utility/functions.py", line 20, in feature_extract hr_pitch = audioFeatureExtraction.stFeatureSpeed(x, Fs, globalvars.frame_size Fs, globalvars.step Fs) File "/usr/local/lib/python3.5/dist-packages/pyAudioAnalysis/audioFeatureExtraction.py", line 679, in stFeatureSpeed [fbank, freqs] = mfccInitFilterBanks(Fs, nfft, lowfreq, linsc, logsc, nlinfil, nlogfil) File "/usr/local/lib/python3.5/dist-packages/pyAudioAnalysis/audioFeatureExtraction.py", line 210, in mfccInitFilterBanks fbank = numpy.zeros((nFiltTotal, nfft)) TypeError: 'float' object cannot be interpreted as an integer

pvanlaar commented 6 years ago

A quick fix might be to replace nfft = Win / 2 on line 663 of audioFeatureExtraction.py with nfft = int(Win / 2)

thaingiW commented 6 years ago

Thank you very much!