Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- aac_cmd = 'ffmpeg -i "{file_name}" -c:a aac -b:a 256k aac/{output_name}.aac'
- opus_cmd = 'ffmpeg -i "{file_name}" -c:a libopus -b:a 96k ./opus/{output_name}.opus'
- mp3_cmd = 'ffmpeg -i "{file_name}" -c:a mp3 -b:a 128k ./mp3/{output_name}.mp3'
- for d in ('mp3', 'opus', 'aac'):
- os.mkdir(d)
- counter = 1
- for f in [x for x in os.listdir() if os.path.isfile(x) if '.flac' in x]:
- os.system(aac_cmd.format(file_name=f, output_name=counter.__str__()))
- os.system(opus_cmd.format(file_name=f, output_name=counter.__str__()))
- os.system(mp3_cmd.format(file_name=f, output_name=counter.__str__()))
- counter += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement