eyeD3 can include newline characters in comments. Any shell method for embedding newlines in the comment string will work. Here are three examples:
Method 1: Using actual newlines in plain quotes
Actual newlines can be embedded in plain quotes:
$ eyeD3 --comment=":Rating:This is
> an even
> better
> song" file.mp3
Method 2: Read the comment in from a multi-line file
Suppose that we have this file;
$ cat comment.txt
This is
the best
song of
a lifetime
We can place that comment in the mp3 file like this:
$ eyeD3 --comment=":Rating:$(cat comment.txt)" file.mp3
Method 3: Using $'...'
To add a multi-line comment to a mp3, one option is to use $'...'
to hold the newline characters:
eyeD3 --comment=$':Rating:This is\nthe best\nsong ever' file.mp3
Once this is done, we can display the multi-line comment to verify that it was properly saved:
$ eyeD3 file.mp3
file.mp3 [ 16.78 KB ]
-------------------------------------------------------------------------------
Time: 00:07 MPEG2, Layer III [ ~16 kb/s @ 11025 Hz - Mono ]
-------------------------------------------------------------------------------
ID3 v2.4:
title: artist:
album: year: None
track:
Comment: [Description: Rating] [Lang: eng]
This is
the best
song ever
The $'...'
construct works well when you want to write the comment on one line of input. $'...'
also supports many other special characters beside newlines.
$'...'
requires bash
.