def convertFsDirWavToWav(dirName, Fs, nC):
 types = (((dirName + os.sep) + '*.wav'),)
 filesToProcess = []
 for files in types:
  filesToProcess.extend(glob.glob(files))
 newDir = ((((((dirName + os.sep) + 'Fs') + str(Fs)) + '_') + 'NC') + str(nC))
 if (os.path.exists(newDir) and (newDir != '.')):
  shutil.rmtree(newDir)
 os.makedirs(newDir)
 for f in filesToProcess:
  (_, wavFileName) = ntpath.split(f)
  command = (((((((((('avconv -i "' + f) + '" -ar ') + str(Fs)) + ' -ac ') + str(nC)) + ' "') + newDir) + os.sep) + wavFileName) + '"')
  print command
  os.system(command)

def convertFsDirWavToWav ( dirName , Fs , nC ) : types = ( ( ( dirName + os . sep ) + '*.wav' ) , ) filesToProcess = [ ] for files in types : filesToProcess . extend ( glob . glob ( files ) ) newDir = ( ( ( ( ( ( dirName + os . sep ) + 'Fs' ) + str ( Fs ) ) + '_' ) + 'NC' ) + str ( nC ) ) if ( os . path . exists ( newDir ) and ( newDir != '.' ) ) : shutil . rmtree ( newDir ) os . makedirs ( newDir ) for f in filesToProcess : ( _ , wavFileName ) = ntpath . split ( f ) command = ( ( ( ( ( ( ( ( ( ( 'avconv -i "' + f ) + '" -ar ' ) + str ( Fs ) ) + ' -ac ' ) + str ( nC ) ) + ' "' ) + newDir ) + os . sep ) + wavFileName ) + '"' ) print command os . system ( command )
this function converts the wav files stored in a folder to wav using a different sampling freq and number of channels .