In [1]:
# http://nbviewer.jupyter.org/github/librosa/librosa/blob/master/examples/LibROSA%20demo.ipynb
import librosa
import librosa.display

import IPython.display

%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np

def player(audio_path):
    return IPython.display.Audio(audio_path)

def spectrogram(audio_path, title):
    y, sr = librosa.load(audio_path, sr=None)
    S = librosa.feature.melspectrogram(y, sr=sr, n_mels=256)
    log_S = librosa.power_to_db(S, ref=np.max)
    plt.figure(figsize=(12,4))
    librosa.display.specshow(log_S, sr=sr, x_axis='time', y_axis='mel', fmax=22050)
    plt.title(title)
    plt.colorbar(format='%+02.0f dB')
    plt.tight_layout()

Opus 16 kbps

$ ffmpeg -i rains.flac -c:a libopus -b:a 16k 16k.opus
In [2]:
audio_path = '16k.opus'
player(audio_path)
Out[2]:
In [3]:
spectrogram(audio_path, 'Opus 16kbps')

Opus 8 kbps

$ ffmpeg -i rains.flac -c:a libopus -b:a 8k 8k.opus
In [4]:
audio_path = '8k.opus'
player(audio_path)
Out[4]: