Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python pydub.silence split_on_silence returning 0 chunk

Tags:

python

I am using split_on_silence function with parameters as shown in below method in python.

I am not getting any single chunk in return. chunks length is 0.

what wrong am I doing?

from pydub import AudioSegment 
from pydub.silence import split_on_silence

song = AudioSegment.from_wav(my_file) 
            
# split track where silence is 0.5 seconds  
# or more and get chunks 
chunks = split_on_silence(song, 
    # must be silent for at least 0.5 seconds 
    # or 500 ms. adjust this value based on user 
    # requirement. if the speaker stays silent for  
    # longer, increase this value. else, decrease it. 
    min_silence_len = 500, 
    
    # consider it silent if quieter than -16 dBFS 
    # adjust this per requirement 
    silence_thresh = -16
) 
like image 889
Anonymous Creator Avatar asked Jun 30 '26 07:06

Anonymous Creator


1 Answers

song.dBFS
-22.4691372540001

silence_thresh - (in dBFS) anything quieter than this will be considered silence.Notice the average loudness of the sound is -22.4 dBFS (quieter than 
 the default silence_thresh of -16dBFS). 

Change the value of silence_thresh = -23.

[worked from silence_thresh = -21]. check this for further details

like image 70
Ajay Avatar answered Jul 01 '26 22:07

Ajay



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!