librosa是一个非常强大的python语音信号处理的第三方库。
学会librosa后再也不用用python去实现那些复杂的算法了,只需要一句语句就能轻松实现。
【librosa官网:https://librosa.org/doc/latest/index.html】
一、Core IO and DSP(核心音频处理函数)
这部分介绍了最常用的音频处理函数,包括音频读取函数load( ),重采样函数resample( ),短时傅里叶变换stft( ),幅度转换函数amplitude_to_db( )以及频率转换函数hz_to_mel( )等。
1、Audio loading
标题1 | 标题2 |
---|---|
load(path, *[, sr, mono, offset, duration, …]) | 从文件加载音频数据,貌似没有格式限制,而且可以通过参数设置是否保留双声道,采样率,重采样类型 Load an audio file as a floating point time series. |
stream(path, *, block_length, frame_length, …) | Stream audio in fixed-length buffers. |
to_mono(y) | 把音频数据降至单声道 Convert an audio signal to mono by averaging sample |