def split(y, top_db=<NUM_LIT>, ref=np.max, frame_length=<NUM_LIT>, hop_length=<NUM_LIT>):
non_silent = _signal_to_frame_nonsilent(y,<EOL>frame_length=frame_length,<EOL>hop_length=hop_length,<EOL>ref=ref,<EOL>top_db=top_db)<EOL>edges = np.flatnonzero(np.diff(non_silent.astype(int)))<EOL>edges = [edges + <NUM_LIT:1>]<EOL>if non_silent[<NUM_LIT:0>]:<EOL><INDENT>edges.insert(<NUM_LIT:0>, [<NUM_LIT:0>])<EOL><DEDENT>if non_silent[-<NUM_LIT:1>]:<EOL><INDENT>edges.append([len(non_silent)])<EOL><DEDENT>edges = core.frames_to_samples(np.concatenate(edges),<EOL>hop_length=hop_length)<EOL>edges = np.minimum(edges, y.shape[-<NUM_LIT:1>])<EOL>return edges.reshape((-<NUM_LIT:1>, <NUM_LIT:2>))<EOL>
Split an audio signal into non-silent intervals.

    Parameters
    ----------
    y : np.ndarray, shape=(n,) or (2, n)
        An audio signal

    top_db : number > 0
        The threshold (in decibels) below reference to consider as
        silence

    ref : number or callable
        The reference power.  By default, it uses `np.max` and compares
        to the peak power in the signal.

    frame_length : int > 0
        The number of samples per analysis frame

    hop_length : int > 0
        The number of samples between analysis frames

    Returns
    -------
    intervals : np.ndarray, shape=(m, 2)
        `intervals[i] == (start_i, end_i)` are the start and end time
        (in samples) of non-silent interval `i`.