def src_callback_new(callback, converter_type, channels):
cb_data = {'<STR_LIT>': callback, '<STR_LIT>': channels}<EOL>handle = ffi.new_handle(cb_data)<EOL>error = ffi.new('<STR_LIT>')<EOL>state = _lib.src_callback_new(_src_input_callback, converter_type,<EOL>channels, error, handle)<EOL>if state == ffi.NULL:<EOL><INDENT>return None, handle, error[<NUM_LIT:0>]<EOL><DEDENT>return state, handle, error[<NUM_LIT:0>]<EOL>
Initialisation for the callback based API.

    Parameters
    ----------
    callback : function
        Called whenever new frames are to be read. Must return a NumPy array
        of shape (num_frames, channels).
    converter_type : int
        Converter to be used.
    channels : int
        Number of channels.

    Returns
    -------
    state
        An anonymous pointer to the internal state of the converter.
    handle
        A CFFI handle to the callback data.
    error : int
        Error code.