MP3 ID3 Tag Reader
This project is a COBOL-based MP3 ID3 tag reader that parses and displays metadata from MP3 files. It uses GnuCOBOL for compilation and execution.
Software Requirements
- GnuCOBOL: Version 3.2.0 or later
- Ensure GnuCOBOL is installed and accessible via the
cobc
command.
- Ensure GnuCOBOL is installed and accessible via the
- Operating System: Linux (tested on May 5, 2025)
- Make: Version 4.3 or later (for building the project)
- Git: Version 2.30.0 or later (for version control)
Project Structure
id3cobol.cbl
: Main COBOL program for reading and parsing MP3 ID3 tags.zero-ord.cbl
: COBOL module for zero-based ordinal conversion.Makefile
: Build automation file for compiling and cleaning the project.audio.mp3
: Sample MP3 file for testing (required for the program to run)..gitignore
: Specifies files and directories to be ignored by Git.
Build Instructions
-
Compile the
zero-ord
module:make zero-ord
-
Compile the
id3cobol
program:make id3cobol
-
Clean up build artifacts:
make clean
-
Perform a deep clean (removes all artifacts):
make distclean
Environment Variables
The following environment variables are important for proper execution:
-
COB_LIBRARY_PATH: Tells COBOL where to find modules
export COB_LIBRARY_PATH=/path/to/workspace:$COB_LIBRARY_PATH
-
COB_PRE_LOAD: Tells COBOL to preload the zero-ord module
export COB_PRE_LOAD=zero-ord
-
LD_LIBRARY_PATH: Helps the Linux dynamic linker find the module
export LD_LIBRARY_PATH=/path/to/workspace:$LD_LIBRARY_PATH
These variables are automatically set when using the VS Code debugger.
Usage
Run the compiled id3cobol
program to parse an MP3 file:
# Using default audio.mp3 file:
./id3cobol
# Using a specific MP3 file:
./id3cobol path/to/your/music.mp3
Note
: Ensure you have an MP3 file with ID3 tags. If no argument is provided, the program will look for
audio.mp3
in the current directory.
VS Code Integration
This project includes VS Code configuration files:
- launch.json: Configures debugging with proper environment variables
- tasks.json: Defines build tasks for compiling the project
To debug in VS Code:
- Press F5 or select "Run and Debug" from the left sidebar
- Select "COBOL debugger" configuration
- The debugger will automatically build and launch the program with audio.mp3
Debugging
To enable debugging, ensure the WS-DEBUG-MODE
variable in id3cobol.cbl
is set to 1
. This will display additional debug information during execution.
License
This project is licensed under the MIT License. See the LICENSE file for details.