Not all of these devices have screens, so I felt it would be useful if the first track on the CD actually spoke the name of the album.
The Problems
The problems encountered were:
- I wanted to automatically work out what to speak (i.e. artist and album)
- I wanted to automatically detect compilation albums.
- I wanted the spoken MP3 to work on all players.
- I wanted the spoken MP3 file to be played first.
- I wanted the spoken MP3 file to contain ID3 tags (including genre and images) consistent with the rest of the album.
Which Tools to Use
My platform is Linux, so I have a large number of tools in my utility belt. I decided to write the script in perl, and use third party programs to perform the manipulation:
??? - ???? : This tool is used to speak the track titles
wget - HTTP Downloader : Used to download files from the internet.
sox - Sound Exchange : This tool is used to adjust the padding of the synthesised wav file.
lame - Lame MP3 Encoder : used to convert the wav file to an MP3 file.
id3 - ID3 Reader / Writer : used to read / write ID3v1 and ID3v2 tags.
ID3 tagger
There are different ways of including information in MP3 files. The original ID3v1 used a fixed structure, located at the start of the MP3 file. This is very powerful, as the ID3v1 tags can be easily read, as they are always in the same place.
The downside of this, however, is it is not expandable, fields are of fixed lengths - certain parameters (such as genres) are limited to a specific set.
This was resolved with the release of ID3v2 - in this case, the ID3 tags are stored in the MP3 stream itself, and can be any size. They can include binary information, such as album covers.
The 'id3' tagging program can add the version 1 or version 2 tags, but must be run twice to tag the file with both. The program can also copy tags from another MP3 file (which is what we will use in our script, to ensure pictures are pulled across).
There are