作者初學乍練實不該多講如何使用 librosa 程式庫之事,此處不過說說測試安裝時閱讀的文件而已。尚祈讀者求教方家也。
於是依著創造者之建議︰
For a quick introduction to using librosa, please refer to the Tutorial. For a more advanced introduction which describes the package design principles, please refer to the librosa paper at SciPy 2015.
先修教程
Tutorial
This section covers the fundamentals of developing with librosa, including a package overview, basic and advanced usage, and integration with the scikit-learn package. We will assume basic familiarity with Python and NumPy/SciPy.
Overview
The librosa package is structured as collection of submodules:
- librosa
- librosa.beat
- Functions for estimating tempo and detecting beat events.
- librosa.core
- Core functionality includes functions to load audio from disk, compute various spectrogram representations, and a variety of commonly used tools for music analysis. For convenience, all functionality in this submodule is directly accessible from the top-level
librosa.*
namespace.
- librosa.decompose
- Functions for harmonic-percussive source separation (HPSS) and generic spectrogram decomposition using matrix decomposition methods implemented in scikit-learn.
- librosa.display
- Visualization and display routines using
matplotlib
.
- librosa.effects
- Time-domain audio processing, such as pitch shifting and time stretching. This submodule also provides time-domain wrappers for the decompose submodule.
- librosa.feature
- Feature extraction and manipulation. This includes low-level feature extraction, such as chromagrams, pseudo-constant-Q (log-frequency) transforms, Mel spectrogram, MFCC, and tuning estimation. Also provided are feature manipulation methods, such as delta features, memory embedding, and event-synchronous feature alignment.
- librosa.filters
- Filter-bank generation (chroma, pseudo-CQT, CQT, etc.). These are primarily internal functions used by other parts of librosa.
- librosa.onset
- Onset detection and onset strength computation.
- librosa.output
- Text- and wav-file output.
- librosa.segment
- Functions useful for structural segmentation, such as recurrence matrix construction, time-lag representation, and sequentially constrained clustering.
- librosa.util
- Helper utilities (normalization, padding, centering, etc.)
Quickstart
Before diving into the details, we’ll walk through a brief example program
※ 註︰ 此處直接使用 jupyter-notebook ,而非 python3 好剪貼而已。
……
然後詳覽系統設計原則︰
接著走馬看花
Librosa example gallery
This notebook demonstrates a simple technique for separating vocals (and other sporadic foreground signals) from accompanying instrumentation.
This is based on the “REPET-SIM” method of Rafii and Pardo, 2012, but includes a couple of modifications and extensions:
- FFT windows overlap by 1/4, instead of 1/2
- Non-local filtering is converted into a soft mask by Wiener filtering. This is similar in spirit to the soft-masking method used by Fitzgerald, 2012, but is a bit more numerically stable in practice.
………
想起當年卡拉 OK 晶片曾有此功能,只是效果不十分好哩!不知今日卻是如何的呦?
結果光為搞定
audioread 2.1.4
multi-library, cross-platform audio decoding
Latest Version: 2.1.5
Decode audio files using whichever backend is available. The library currently supports:
- Gstreamer via PyGObject.
- Core Audio on Mac OS X via ctypes. (PyObjC not required.)
- MAD via the pymad bindings.
- FFmpeg or Libav via its command-line interface.
- The standard library wave, aifc, and sunau modules (for uncompressed audio formats).
能在 raspbian stretch 裡讀 mp3 檔︰
sudo apt-get install ffmpeg
sudo apt-get install libavcodec-extra-53 libavcodec-extra-56 libavcodec-extra57
sudo apt-get install libav-tools
天都已經黑了?!呆望著分離頻譜,哪曉聽來怎麼樣的啊★☆