utils.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:TF-FaceLandmarkDetection 作者: mariolew 项目源码 文件源码
def load_audio(filename, b_normalize=True):
    """Load the audiofile at the provided filename using scipy.io.wavfile.

    Optionally normalizes the audio to the maximum value.

    Parameters
    ----------
    filename : str
        File to load.
    b_normalize : bool, optional
        Normalize to the maximum value.
    """
    sr, s = wavfile.read(filename)
    if b_normalize:
        s = s.astype(np.float32)
        s = (s / np.max(np.abs(s)))
        s -= np.mean(s)
    return s
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号