Skip to main content
← Portfolio

Music Tagger

Swift · AVFoundation

A command line interface for automating the conversion of audio files, tagging them with metadata, and uploading them to Apple Music. See the GitHub repository linked above for usage and source code.

Motivation

Uploading local files to Apple Music with custom metadata can take a lot of time. I built Music Tagger to speed up this process by setting audio file metadata in bulk and exporting to iTunes so the files upload straight to my cloud library.

How It Works

Music Tagger is designed to process a set of closely related files in bulk from a folder on your local machine — for example, songs from the same album. It uses the Swift ArgumentParser to pass options to the program, then converts all audio files to M4A (Apple's audio format) using the AVFoundation framework. Metadata is set as specified, and the song is moved to your local iTunes library. Files are processed in parallel using modern Swift concurrency. Files should already be in M4A to preserve the explicit song label. See the README in the GitHub repository for more on usage and CLI options.

Limitations

One current limitation is that it requires manual verification that files have successfully uploaded to your iTunes library. In my experience this is usually about a 95% success rate, but occasionally an upload process will crash after Music Tagger runs, which then requires a re-run.