zoukankan      html  css  js  c++  java
  • PyAudio 中文手册--静音移除/有声检测

    静音移除/有声检测

    audioSegmentation.py中的silenceRemoval()方法将连续的音频拆分为独立的事件片段,即静默的信号都被移除掉了。 其实现主要通过一个半监督方法:首先训练一个SVM模型来分辨(短期时长的)高能信号与低能信号,使用其中10%的高能片段和10%的低能片段来作为训练集。然后对整段音频应用这一SVM训练模型,并使用动态的阈值来判断动态的片段。

    核心方法:silenceRemoval(x, fs, st_win, st_step, smoothWindow=0.5, weight=0.5, plot=False)

    def silenceRemoval(x, fs, st_win, st_step, smoothWindow=0.5, weight=0.5, plot=False):
        '''
        Event Detection (silence removal)
        ARGUMENTS:
             - x:                the input audio signal
             - fs:               sampling freq
             - st_win, st_step:    window size and step in seconds
             - smoothWindow:     (optinal) smooth window (in seconds)
             - weight:           (optinal) weight factor (0 < weight < 1) the higher, the more strict
             - plot:             (optinal) True if results are to be plotted
        RETURNS:
             - seg_limits:    list of segment limits in seconds (e.g [[0.1, 0.9], [1.4, 3.0]] means that
                        the resulting segments are (0.1 - 0.9) seconds and (1.4, 3.0) seconds
        '''
    

    参数:

    x: 输入的音频(数字化的) fs: 采样频率 st_win, st_step: 短期时长的窗口及步长 smoothWindow=0.5: 平滑窗口(单位秒) weight=0.5: 决策阈值(越高越严格) plot=False: 是否可视化结果

    返回结果seg_limits是一个数组,表示非静音(有声)片段的起止时间。

    根据音频性质的不同,也应该使用不同的平滑窗口和决策阈值。上述的样本中,声音是非常稀疏的。对于持续的讲话,应该使用更短(值更小)的平滑窗口和更严格的(值更大)的决策阈值。

    全部手册:https://www.cnblogs.com/liuzhongrong/p/12269181.html

  • 相关阅读:
    Fragment_3_Androidx中返回键的处理
    2.2.3.Architecture components_View Binding
    2.2.2.Architecture components_data binding2_源码分析
    经典排序
    动态规划求解最长公共子序列
    全排列问题
    钢条切割
    KMP
    Queue
    Stack
  • 原文地址:https://www.cnblogs.com/xtmp/p/12670758.html
Copyright © 2011-2022 走看看