Caution

You're reading an old version of this documentation. If you want up-to-date information, please have a look at 0.9.1.

librosa.core.to_mono

librosa.core.to_mono(y)[source]

Force an audio signal down to mono by averaging samples across channels.

Parameters
ynp.ndarray [shape=(2,n) or shape=(n,)]

audio time series, either stereo or mono

Returns
y_mononp.ndarray [shape=(n,)]

y as a monophonic time-series

Notes

This function caches at level 20.

Examples

>>> y, sr = librosa.load(librosa.util.example_audio_file(), mono=False)
>>> y.shape
(2, 1355168)
>>> y_mono = librosa.to_mono(y)
>>> y_mono.shape
(1355168,)