Guest User

Untitled

a guest
Dec 17th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. #!/usr/bin/python
  2. ##################################################
  3. # Progran: ALL MP3s to WAV #
  4. # Version: 0.1 #
  5. # Company: 6ft Dan(TM) #
  6. # Author : Daniel P. Clark #
  7. # Date : <= 2005 #
  8. # E-mail : #
  9. # ABOUT : converts mp3s #
  10. ##################################################
  11. import sys, os, string
  12.  
  13. Mpg123 = "/usr/bin/mpg123" # creates variable for mpg123 program
  14.  
  15. mylist = []
  16.  
  17. def menu():
  18. global mylist
  19. directory="." # for now, the current directory
  20. mylist = os.listdir(directory) # get list of files in current directory
  21. for x in range(len(mylist)):
  22. if string.lower(mylist[x][-3:]) != "mp3":
  23. continue
  24. else:
  25. mpFile = os.path.join(directory, mylist[x])
  26. wavFile = mpFile[:-4] + ".wav"
  27. os.system(Mpg123 + " -w \"" + wavFile + "\" \"" + mpFile + "\"")
  28. sys.exit()
  29.  
  30. if __name__ == '__main__':
  31. while 1:
  32. menu() # Run the program!
Add Comment
Please, Sign In to add comment