GuilhemBaiss / SilenceDetection

Algorithm that uses the fundamental frequency to detect silences in a dialogue
3 stars 1 forks source link

TypeError: '>' not supported between instances of 'numpy.ndarray' and 'str'` #2

Open mkachlicka opened 1 year ago

mkachlicka commented 1 year ago

I encountered the following issue. Do you know what might be the cause of it?

Extracting silences for : M2095.wav Traceback (most recent call last): File "detectSilences.py", line 209, in <module> silences = detect_silences(path_sound_file, MINIMUM_SILENCE_DURATION, 0, getSoundFileLength(path_sound_file)) File "detectSilences.py", line 34, in detect_silences silences += __detect_silence_in_frame(pathSound, start_frame, end_frame, minimum_silence_duration, high_outliers_value,low_outliers_value ) File "detectSilences.py", line 85, in __detect_silence_in_frame if duration > minimum_silence_duration: TypeError: '>' not supported between instances of 'numpy.ndarray' and 'str'

mkachlicka commented 1 year ago

It seems that changing the type of variables duration and minimum_silence duration to float (from str) did the job, and it's extracting the silences now.

I have a question, though. When I set the minimum_silence_duration to any number, the output still includes silences of durations shorter than the selected threshold. For example, when I set it to 10, the output lists values such as 0.07, 0.44, and 2.8, which are much smaller than 10 s. Would you be able to advise how to solve this, please?

Screenshot 2023-02-17 at 09 43 48