A command-line tool written in C that reads and edits ID3v2 metadata tags in MP3 files — Title, Artist, Album, Year, Genre, and Composer — without touching the audio data.
Built as part of the Emertxe Advanced C / Embedded Systems training (Skill India / NSDC — QP ELE/Q1501).
MP3 files store metadata in a structured header called ID3v2, located at the beginning of the file. Each piece of metadata is stored in a frame with a 4-byte ID:
| Frame ID | Metadata |
|---|---|
TIT2 |
Title |
TPE1 |
Artist |
TALB |
Album |
TYER |
Year |
TCON |
Genre |
TCOM |
Composer |
Each frame has: 4-byte Frame ID + 4-byte Size + 2-byte Flags + 1-byte Encoding + Text data.
- View all ID3v2 metadata tags from any MP3 file
- Edit any individual tag (Title, Artist, Album, Year, Genre, Composer)
- Auto-creates a backup before editing (
filename_backup.mp3) - Safe editing via temporary file — audio data is never touched
- Input validation with detailed error messages
- Help menu (
--help)
MP3-Tag-Reader-Editor/
├── main.c → CLI argument parsing, operation dispatcher
├── view.c → ID3v2 header parsing and tag display
├── view.h → View function declarations
├── edit.c → Frame editing with temp file and backup
├── edit.h → Edit function declarations
├── operations.c → Shared utility functions
├── operations.h → Shared function declarations
├── sample.mp3 → Sample MP3 file for testing
└── Makefile
make./mp3tag -v sample.mp3./mp3tag -e -t "New Title" sample.mp3 # Edit Title
./mp3tag -e -a "New Artist" sample.mp3 # Edit Artist
./mp3tag -e -A "New Album" sample.mp3 # Edit Album
./mp3tag -e -y "2025" sample.mp3 # Edit Year
./mp3tag -e -m "New Genre" sample.mp3 # Edit Genre
./mp3tag -e -c "New Composer" sample.mp3 # Edit Composer./mp3tag --help-----SELECTED VIEW DETAILS-------
MP3 TAG READER AND EDITOR FOR ID3V2
Title : Sunny Sunny
Artist : Yo Yo Honey Singh
Album : Yaariyan
Year : 2013
Genre : Bollywood Music - [SongsPk.CC]
Composer : Downloaded From SongsPk.CC
-----SELECTED EDIT OPERATION-----
Backup created: sample.mp3_backup.mp3
Editing TIT2...
Tag updated successfully!
--------UPDATED MP3 DETAILS--------
Title : New Title
Artist : Yo Yo Honey Singh
Album : Yaariyan
Year : 2013
- Binary File I/O —
fopen("rb"/"wb"),fread,fwrite,fseekfor precise byte-level MP3 parsing - ID3v2 Frame Parsing — reading 4-byte frame IDs and sizes from binary header
- Safe File Editing — write to
temp.mp3, then replace original; backup created before any change - Command-line Arguments —
argc/argvwith flag parsing (-v,-e,-t,--help) - Modular Design — view.c / edit.c / operations.c with separate headers
- String Functions —
strcmp,strncmp,strcpyfor frame ID matching
- Supports ID3v2.3 only (not ID3v1 or ID3v2.4)
- Text encoding assumed to be ISO-8859-1 (encoding byte = 0x00)
- Edit rewrites all 6 supported frames — unsupported frames are preserved but not parsed
- No support for multi-value tags (e.g., multiple artists)
Suchithra S
B.E. ECE — Gopalan College of Engineering & Management, VTU (2025)
Advanced Embedded Systems Training — Emertxe Information Technologies, Bengaluru
GitHub: github.com/suchithrasr
LinkedIn: linkedin.com/in/suchithrasr