(self, bit)
Write a bit to tape.
Write a bit to tape.
Write a bit to tape .
def write_bit(self, bit):
        """Write a bit to tape."""
        half_length = self.halflength[bit]
        down = {1: b'\x00', 2: b'\x00\x80'}
        up = {1: b'\xff', 2: b'\xff\x7f'}
        self.wav.write(
            down[self.sampwidth] * self.nchannels * half_length +
            up[self.sampwidth] * self.nchannels * half_length
        )
        self.wav_pos += 2 * half_length
def write_bit ( self , bit ) : half_length = self . halflength [ bit ] down = { 1 : b'\x00' , 2 : b'\x00\x80' } up = { 1 : b'\xff' , 2 : b'\xff\x7f' } self . wav . write ( down [ self . sampwidth ] * self . nchannels * half_length + up [ self . sampwidth ] * self . nchannels * half_length ) self . wav_pos += 2 * half_length