After investigating, I found that I could download an app called Switch and convert it.
However, the free portion had the disadvantage that only 5 cases could be converted at a time.
So, I made a program myself, so that memo.
brew install ffmpeg
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import os
import fnmatch
from subprocess import call
matches = []
for root, dirnames, filenames in os.walk('./'):
for filename in fnmatch.filter(filenames,'*.wma'):
matches.append(os.path.join(os.path.abspath(root), filename))
for match in matches:
message = "convert {0} to {1}".format(match, match.replace('.wma', '.mp3'))
before = match.decode('utf-8')
after = before.replace('.wma', '.mp3')
print message
if os.path.exists(after):
print 'This file is already converted.'
else:
call(u'ffmpeg -i "{0}" "{1}"'.format(before, after), shell=True)
Be ready to run
chmod +x wma2mp3.py
mv wma2mp3.py /usr/bin/
Execute the following command in the directory containing the file you want to convert
wma2mp3.py
Recommended Posts