def wavplay(filename):
 if (os.path.isfile(filename) == False):
  print 'Input file does not exist. Make sure you computed the analysis/synthesis'
 elif ((sys.platform == 'linux') or (sys.platform == 'linux2')):
  subprocess.call(['aplay', filename])
 elif (sys.platform == 'darwin'):
  subprocess.call(['afplay', filename])
 elif (sys.platform == 'win32'):
  if winsound_imported:
   winsound.PlaySound(filename, winsound.SND_FILENAME)
  else:
   print 'Cannot play sound, winsound could not be imported'
 else:
  print 'Platform not recognized'

def wavplay ( filename ) : if ( os . path . isfile ( filename ) == False ) : print 'Input file does not exist. Make sure you computed the analysis/synthesis' elif ( ( sys . platform == 'linux' ) or ( sys . platform == 'linux2' ) ) : subprocess . call ( [ 'aplay' , filename ] ) elif ( sys . platform == 'darwin' ) : subprocess . call ( [ 'afplay' , filename ] ) elif ( sys . platform == 'win32' ) : if winsound_imported : winsound . PlaySound ( filename , winsound . SND_FILENAME ) else : print 'Cannot play sound, winsound could not be imported' else : print 'Platform not recognized'
play a wav audio file from system using os calls filename: name of file to read .