def _getFlacPath(path=None):
 global FLAC_PATH
 if (FLAC_PATH is None):
  if path:
   FLAC_PATH = path
  elif prefs.general['flac']:
   FLAC_PATH = prefs.general['flac']
  else:
   FLAC_PATH = 'flac'
  try:
   (version, se) = core.shellCall([FLAC_PATH, '-v'], stderr=True)
   if se:
    raise MicrophoneError
  except Exception:
   msg = 'flac not installed (or wrong path in prefs); download from https://xiph.org/flac/download.html'
   logging.error(msg)
   raise MicrophoneError(msg)
  logging.info(('Using ' + version))
 return FLAC_PATH

def _getFlacPath ( path = None ) : global FLAC_PATH if ( FLAC_PATH is None ) : if path : FLAC_PATH = path elif prefs . general [ 'flac' ] : FLAC_PATH = prefs . general [ 'flac' ] else : FLAC_PATH = 'flac' try : ( version , se ) = core . shellCall ( [ FLAC_PATH , '-v' ] , stderr = True ) if se : raise MicrophoneError except Exception : msg = 'flac not installed (or wrong path in prefs); download from https://xiph.org/flac/download.html' logging . error ( msg ) raise MicrophoneError ( msg ) logging . info ( ( 'Using ' + version ) ) return FLAC_PATH
return a path to flac binary .