检测与检测用Python录制音频-修剪开始静音 [英] Detect & Record Audio in Python - trim beginning silence
本文介绍了检测与检测用Python录制音频-修剪开始静音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用此答案中的脚本,不会限制录制开始时的静音.
using the script in this answer, silence at the beginning of the recording is not clipped.
首先,我正在使用python3.
fwiw, im using python3.
我实际上稍微调整了脚本,以下是我的副本: https://wtools.io/paste-code/b2tk
as ive actually slightly tweaked the script, heres my copy: https://wtools.io/paste-code/b2tk
推荐答案
该问题是由于麦克风启动时发出的快速,听不见的声音而引起的.在 r = normalize(r)
之前添加 del r [0:8000]
可以消除包含听不见声音数据的音频的第一时刻,从而解决了我的问题.
the issue was due to a quick, inaudible flash of sound when the mic was started. adding del r[0:8000]
before r = normalize(r)
eliminated the first moments of audio containing the inaudible sound data, solving my issue.
这篇关于检测与检测用Python录制音频-修剪开始静音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文