Skip to content

Instantly share code, notes, and snippets.

@EnriqueSoria
Created August 29, 2018 09:05
Show Gist options
  • Save EnriqueSoria/fa0fe3109558e0cabf5a38e283b64f7c to your computer and use it in GitHub Desktop.
Save EnriqueSoria/fa0fe3109558e0cabf5a38e283b64f7c to your computer and use it in GitHub Desktop.
AAC to MP3
from os import listdir as ls
from os.path import abspath
from subprocess import run
FFMPEG = r"C:\Another_apps\ffmpeg\bin\ffmpeg.exe"
command = '{program} -i "{inp}" -acodec libmp3lame "{out}"'
file_extension = '.aac'
for file in ls('.'):
if file.endswith(file_extension):
file = file.replace(file_extension, '')
run(
command.format(
program = FFMPEG,
inp = abspath('./' + file + file_extension),
out = abspath('./' + file + '.mp3')
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment