code: def convert(source_file, destination_file, cfg):
      
      source_ext = os.path.splitext(source_file)[1]
      source_ext = source_ext.lower()
  
      dest_ext = os.path.splitext(destination_file)[1]
      dest_ext = dest_ext.lower()
  
      if source_ext not in (".wav", ".cas", ".bas"):
          raise AssertionError(
              "Source file type %r not supported." % repr(source_ext)
          )
      if dest_ext not in (".wav", ".cas", ".bas"):
          raise AssertionError(
              "Destination file type %r not supported." % repr(dest_ext)
          )
  
      print "Convert %s -> %s" % (source_ext, dest_ext)
  
      c = Cassette(cfg)
  
      if source_ext == ".wav":
          c.add_from_wav(source_file)
      elif source_ext == ".cas":
          c.add_from_cas(source_file)
      elif source_ext == ".bas":
          c.add_from_bas(source_file)
      else:
          raise RuntimeError # Should never happen
  
      c.print_debug_info()
  
      if dest_ext == ".wav":
          c.write_wave(destination_file)
      elif dest_ext == ".cas":
          c.write_cas(destination_file)
      elif dest_ext == ".bas":
          c.write_bas(destination_file)
      else:
          raise RuntimeError
docs: convert in every way.