def flac2wav(path, keep=True):
 flac_path = _getFlacPath()
 flac_files = []
 if path.endswith('.flac'):
  flac_files = [path]
 elif ((type(path) == str) and os.path.isdir(path)):
  flac_files = glob.glob(os.path.join(path, '*.flac'))
 if (len(flac_files) == 0):
  logging.warn(('failed to find .flac file(s) from %s' % path))
  return None
 wav_files = []
 for flacfile in flac_files:
  wavname = (flacfile.strip('.flac') + '.wav')
  flac_cmd = [flac_path, '-d', '--totally-silent', '-f', '-o', wavname, flacfile]
  (_junk, se) = core.shellCall(flac_cmd, stderr=True)
  if se:
   logging.error(se)
  if (not keep):
   os.unlink(flacfile)
  wav_files.append(wavname)
 if (len(wav_files) == 1):
  return wav_files[0]
 else:
  return wav_files

def flac2wav ( path , keep = True ) : flac_path = _getFlacPath ( ) flac_files = [ ] if path . endswith ( '.flac' ) : flac_files = [ path ] elif ( ( type ( path ) == str ) and os . path . isdir ( path ) ) : flac_files = glob . glob ( os . path . join ( path , '*.flac' ) ) if ( len ( flac_files ) == 0 ) : logging . warn ( ( 'failed to find .flac file(s) from %s' % path ) ) return None wav_files = [ ] for flacfile in flac_files : wavname = ( flacfile . strip ( '.flac' ) + '.wav' ) flac_cmd = [ flac_path , '-d' , '--totally-silent' , '-f' , '-o' , wavname , flacfile ] ( _junk , se ) = core . shellCall ( flac_cmd , stderr = True ) if se : logging . error ( se ) if ( not keep ) : os . unlink ( flacfile ) wav_files . append ( wavname ) if ( len ( wav_files ) == 1 ) : return wav_files [ 0 ] else : return wav_files
uncompress: convert .