def _check_data(data):
if not (data.dtype == _np.float32 and data.flags.c_contiguous):<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if data.ndim == <NUM_LIT:2>:<EOL><INDENT>num_frames, channels = data.shape<EOL><DEDENT>elif data.ndim == <NUM_LIT:1>:<EOL><INDENT>num_frames, channels = data.size, <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>return num_frames, channels<EOL>
Check whether `data` is a valid input/output for libsamplerate.

    Returns
    -------
    num_frames
        Number of frames in `data`.
    channels
        Number of channels in `data`.

    Raises
    ------
        ValueError: If invalid data is supplied.