librosa.util.valid_intervals

librosa.util.valid_intervals(intervals)[source]

Ensure that an array is a valid representation of time intervals:

  • intervals.ndim == 2

  • intervals.shape[1] == 2

  • intervals[i, 0] <= intervals[i, 1] for all i

Parameters:
intervalsnp.ndarray [shape=(n, 2)]

set of time intervals

Returns:
validbool

True if intervals passes validation.