Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to create a script that performs various conversions between formats of audio files. In one particular step, I use afconvert in Terminal to convert an mp3 to aac(mpeg4/m4a), but in this process all of the info attached to the audio file (name, artist etc) is lost. I tried to id3cp to copy over the info but this doesn't work (I think because aac files don't use ID3 tags...).

Could someone suggest a way of copying all of the associated info on the mp3 files to the aac (m4a) file? Is there a way it can be retained during the conversion (preferable) or alternately a Terminal command to copy the info over?

share|improve this question

I prefer the mutagen Python library for tag editing, since it has good support for a wide variety of formats with a consistent interface. Here’s a script for copying the metadata of a file:

import mutagen
import mutagen.easyid3
old = mutagen.easyid3.EasyID3('example.mp3') 
new = mutagen.File('example.m4a') 

You can open any file with mutagen.File, but that gives you raw access to the coded ID3 tags like 'TPE1', instead of human-readable tags like 'artist', so EasyID3 is used instead.

share|improve this answer
Even better, create a small executable python script with the above code. You can use the argparse library to create a commandline interface for your tag copier. – Thucydides411 Sep 28 '14 at 22:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.