ngoding / bangkit-project

0 stars 2 forks source link

Error encountered while parsing file (Feature extraction) #13

Closed ngoding closed 4 years ago

ngoding commented 4 years ago

Hey @LaodeMFauzan, I've got a few errors here. Did you get this error too? Screen Shot 2020-04-03 at 10 00 30

ngoding commented 4 years ago

I've commented the exception part. Here's the error: 517 518 if as_index and x.min() < 0: --> 519 raise ValueError("index can't contain negative values") 520 521 # Converting the array with tolist seems to improve performance

ValueError: index can't contain negative values

LaodeMFauzan commented 4 years ago

image

I got the error too, but in the end, it successfully extracts the features from all the files.

image

ngoding commented 4 years ago

I think that might be the reason. Some file cannot be extracted so our data isn't balanced. Do you know what might have caused the "ValueError: index can't contain negative values" error?

ngoding commented 4 years ago

60 Files aren't converted. I'm trying to fix it now

LaodeMFauzan commented 4 years ago

@ngoding sorry for the late reply. How is the fix going?

Rocksus commented 4 years ago

@LaodeMFauzan, can you explain what pad_width is being used for in the function? I'm seeing that the negative values are coming from the pad_width

LaodeMFauzan commented 4 years ago

@Rocksus Padding is a process to add values to a time-domain signal to increase its length. Pad_width is a variable used to determine how long the additional value. That's what I understand from reading several articles:

Rocksus commented 4 years ago

@LaodeMFauzan ahh i see, so in the case of a negative pad_width can we just trim the audio instead?

ngoding commented 4 years ago

Hi, From my understanding, then the padding tried to add padding in front of the audio while it should be in the end?

LaodeMFauzan commented 4 years ago

@Rocksus we can do that, because from what I understand most of the error parsing coming from file with length more than 20s. Max pad length 862 is corresponding with an audio file with 20s length. @ngoding I think the padding is already placed at the end. The problem is at the length of the file. I'll try to change the line of librosa.load to this: audio, sample_rate = librosa.load(file_name, res_type='kaiser_fast', duration=20)

turns out adding that one line solves the problem.

Also, the kaiser_fast type is used for the faster resampling method.