base_features.py 文件源码

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

项目:catchy 作者: jvbalen 项目源码 文件源码
def get_onsets(x, sr):
    """Compute inter-onset intervals (IOI) from audio, using librosa.

    Args:
        x (1d-array) audio signal, mono
        sr (int): sample rate

    Returns:
        2d-array: onset times and IOI
    """

    onset_frames = librosa.onset.onset_detect(x, sr=sr)
    onset_times = librosa.frames_to_time(onset_frames, sr=sr)

    t = onset_times[:-1,]
    onset_intervals = np.diff(onset_times)

    return t, onset_intervals
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号