def write(self, data):
        """Write data into the ringbuffer.

        Parameters
        ----------
        data : buffer or bytes or iterable of int
            Bytes to be written to the ringbuffer.

        Returns
        -------
        int
            The number of bytes written, which could be less than the
            length of `data` if there was no more space left
            (see :attr:`write_space`).

        See Also
        --------
        :attr:`write_space`, :attr:`write_buffers`

        """
        try:
            data = _ffi.from_buffer(data)
        except __HOLE__:
            pass  # from_buffer() not supported
        except TypeError:
            pass  # input is not a buffer
        return _lib.jack_ringbuffer_write(self._ptr, data, len(data))
dataset/ETHPy150Open spatialaudio/jackclient-python/jack.py/RingBuffer.write