This Python script cdrdao.py takes the tracks as audio files on the command line, converts them with
sox, and creates
.toc files for
cdrdao. Any extra space on the CD is distributed evenly as silence between the tracks, and if multiple CDs are required then the script will also try to distribute the tracks evenly across CDs (while keeping them in order). CD-TEXT labels from the original filenames are also added.
Appending silent MP3 frames, including via
vbrfix, doesn't work with all forms of metadata on all players---Apple products are particularly fussy---so it might be best to re-code the file. This does mean possible loss of sound quality, and loss of metadata, but you can at least try to ensure the quality is set adequately and the title is copied over. Something like this (adjust quality setting and length of silence appropriately):
for N in *.mp3; do (sox "$N" -t raw -r 44100 -c 2 -s -2 -;dd if=/dev/zero bs=84672 count=10000)|lame -V 0 -r -s 44.1 - --tt "$(echo $(mpg123 --long-tag -n 1 "$N" 2>&1 | grep '^[^A-Za-z]*Title'|sed -e 's/^[^A-Za-z]*Title://'))" -o tmp.mp3 ; mv tmp.mp3 "$N"; done