snakers4 / silero-vad

Silero VAD: pre-trained enterprise-grade Voice Activity Detector
MIT License
3.34k stars 349 forks source link

❓ Help! My old code raise error after loading v5 model #485

Closed Simon-chai closed 2 days ago

Simon-chai commented 2 days ago

I used to use v4 model and everything is ok. Today I decide to try v5 model,and I load the v5 model from local,then my old code can't successfully run!The error come form this line of code:

audio:AudioSegment = AudioSegment.from_file(io.BytesIO(temp), format="webm")
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

And the error is :

File "D:\software\anaconda3\envs\myenv\Lib\site-packages\pydub\audio_segment.py", line 773, in from_file
    raise CouldntDecodeError(
pydub.exceptions.CouldntDecodeError: Decoding failed. ffmpeg returned error code: 1

I don't find any relation between my code and silero-vad model, and my code work just fine with v4 model. Do anyone have any idea?

snakers4 commented 2 days ago

Looks like an ffmpeg error that pydub uses as a backend.

Generally, sox based libraries work better for audio.

Simon-chai commented 2 days ago

Looks like an ffmpeg error that pydub uses as a backend.

Generally, sox based libraries work better for audio.

Yes,I know the error,but what I don't know is, what have changed after I load the v5 model?Cause everything is ok when I use v4 model. All the thing I change is the model directory. Maybe I should reproducing it in the most simple code to locate the problem. Most likely is just because some of my dump code. If there is a bug,I will open a new issue.