def write(self, data):
        data = bytes(data)
        assert len(data) % self.bytes_per_sample == 0
        buf = ctypes.c_char_p(data)
        frames = ctypes.c_ulong(len(data) // self.bytes_per_sample)
        self.interface.call('WriteStream', self.stream, buf, frames)
dataset/ETHPy150Open romanz/amodem/amodem/audio.py/Stream.write/original