Beat Tracking with librosa

See ELEN E4896 Music Signal Processing

2016-03-30 Dan Ellis dpwe@ee.columbia.edu


In [1]:
%pylab inline
from __future__ import print_function
import librosa
import numpy as np
import os
import IPython
import mir_eval   # from "pip install mir_eval"


Populating the interactive namespace from numpy and matplotlib
/Applications/anaconda/lib/python2.7/site-packages/librosa/core/audio.py:37: UserWarning: Could not import scikits.samplerate. Falling back to scipy.signal
  warnings.warn('Could not import scikits.samplerate. '

In [2]:
MIREX_DATA_DIR = '/Users/dpwe/Downloads/prac09/mirex06examples'

In [3]:
# Read in an example soundfile.
example = 'train01'
filename = os.path.join(MIREX_DATA_DIR, example + '.wav')
y, sr = librosa.load(filename, sr=None)
print("Sample rate:", sr, "Data shape:", y.shape)
IPython.display.Audio(data=y, rate=sr)


Sample rate: 44100 Data shape: (1323000,)
Out[3]: