Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audio segmentation, mt_file_classification: IndexError #355

Open
VivT94 opened this issue Jul 12, 2021 · 0 comments
Open

Audio segmentation, mt_file_classification: IndexError #355

VivT94 opened this issue Jul 12, 2021 · 0 comments

Comments

@VivT94
Copy link

VivT94 commented Jul 12, 2021

Hi, while working on a project for university, we came across pyAudioAnalysis. Our goal is to classify noises during nighttime into either "snoring" or "no snoring". I trained a svm classifier with a few sample audio files and afterwards applied the functions "silence removal" and "mid_term_file_classification" - see code below:

from pyAudioAnalysis import audioBasicIO as aIO
from pyAudioAnalysis import audioSegmentation as aS

[Fs, x] = aIO.read_audio_file("../data/training_data/mixed/soundsample.wav")
segments = aS.silence_removal(x, Fs, 0.020, 0.020, smooth_window = 1.0, weight = 0.3, plot = True)

[flagsInd, classesAll, acc, CM] = aS.mid_term_file_classification("../data/training_data/mixed/soundsample.wav",
"svm_NoSnoring_Snoring", "svm", True,
'../data/training_data/mixed/soundsample.segments')

The silence removal works totally fine, but unfortunately, the "mid_term_file_classification" gives this IndexError:
"File "C:\Users.......\pyAudioAnalysis\audioSegmentation.py", line 115, in segments_to_labels
while index < end_times[-1]:
IndexError: index -1 is out of bounds for axis 0 with size 0"

Can anyone help? Also, I created an empty .segments-file before running this code, but it remains empty.

Thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant