Guest User

Untitled

a guest
Jun 18th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #! /usr/bin/python
  2. ### Convert Audio for iPhone Project
  3. import os.path
  4. import subprocess
  5. import shutil
  6.  
  7. def main():
  8. dir = '/Users/Liz/Dropbox/Projects/BoardGame/Sound'
  9. files = os.listdir(dir)
  10. os.chdir(dir)
  11. for file in files:
  12. if file.endswith('m4a'):
  13. newfile = file.replace('m4a','caf')
  14. print(newfile)
  15. commandlist = ['/usr/bin/afconvert', '-f', 'caff', '-d', 'LEI16',file,newfile]
  16. subprocess.call(commandlist)
  17. os.remove(file)
  18.  
  19. if __name__ == '__main__':
  20. main()
Add Comment
Please, Sign In to add comment