python pydub.silence在\u silence上拆分\u返回0块

2024-05-14 10:08:36 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用split\u on\u silene函数,其参数如下面python中的方法所示

我没有得到任何一块钱作为回报。区块长度为0

我做错了什么

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
) 

Tags: orfromimportforsongonthischunks
1条回答
网友
1楼 · 发布于 2024-05-14 10:08:36
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). 

更改silence_thresh = -23的值

[从silence_thresh = -21开始工作]。查看this了解更多详细信息

相关问题 更多 >

    热门问题