Closed ngoding closed 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
I got the error too, but in the end, it successfully extracts the features from all the files.
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?
60 Files aren't converted. I'm trying to fix it now
@ngoding sorry for the late reply. How is the fix going?
@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
@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:
@LaodeMFauzan ahh i see, so in the case of a negative pad_width can we just trim the audio instead?
Hi, From my understanding, then the padding tried to add padding in front of the audio while it should be in the end?
@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.
Hey @LaodeMFauzan, I've got a few errors here. Did you get this error too?