librosa.core.to_mono

librosa.core.to_mono(y)[source]

Force an audio signal down to mono.

Parameters:
y : np.ndarray [shape=(2,n) or shape=(n,)]

audio time series, either stereo or mono

Returns:
y_mono : np.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,)