def read(self, size):
        assert size % self.bytes_per_sample == 0
        buf = ctypes.create_string_buffer(size)
        frames = ctypes.c_ulong(size // self.bytes_per_sample)
        t0 = self.timer()
        self.interface.call('ReadStream', self.stream, buf, frames)
        t1 = self.timer()
        self.io_time += (t1 - t0)
        if self.interface.debug:
            io_wait = self.io_time / (t1 - self.start_time)
            log.debug('I/O wait: %.1f%%', io_wait * 100)
        return buf.raw
dataset/ETHPy150Open romanz/amodem/amodem/audio.py/Stream.read/original