(self)
Read the leader / pilot wave.
Read the leader / pilot wave.
Read the leader / pilot wave .
def read_leader(self):
        """Read the leader / pilot wave."""
        try:
            while True:
                while self.read_bit() != 1:
                    pass
                counter = 0
                while True:
                    b = self.read_bit()
                    if b != 1:
                        break
                    counter += 1
                # sync bit 0 has been read, check sync byte 0x16
                # at least 64*8 bits
                if b is not None and counter >= 512:
                    sync = self.read_byte(skip_start=True)
                    if sync == self.sync_byte:
                        return True
        except EndOfTape:
            return False
def read_leader ( self ) : try : while True : while self . read_bit ( ) != 1 : pass counter = 0 while True : b = self . read_bit ( ) if b != 1 : break counter += 1 # sync bit 0 has been read, check sync byte 0x16 # at least 64*8 bits if b is not None and counter >= 512 : sync = self . read_byte ( skip_start = True ) if sync == self . sync_byte : return True except EndOfTape : return False