def whathdr(filename):
 f = open(filename, 'rb')
 h = f.read(512)
 for tf in tests:
  res = tf(h, f)
  if res:
   return res
 return None

def whathdr ( filename ) : f = open ( filename , 'rb' ) h = f . read ( 512 ) for tf in tests : res = tf ( h , f ) if res : return res return None
recognize sound headers .