Adding Album Cover to a FLAC File

When converting a wave file to a FLAC file using the flac command, an album cover can also be added by using the –picture argument with an input image file.

$ flac -0 ... --picture="3|image/jpeg|||cover.jpg" ... filename.wav

where 3 means that the picture is a front cover, cover.jpg is the cover image file, and filename.wav is the name of the input wave file.

Alternatively, metaflac can be used to add an album cover to a FLAC file.

$ metaflac --import-picture-from="3|image/jpeg|||cover.jpg" filename.flac

where the format of the –import-picture-from argument follows the –picture argument of the flac command, and filename.flac is the name of the FLAC file to be processed.

Note: flac and metaflac may not be present in a default installation. It can be installed through the package manager.

References

[1] https://sharpbang.wordpress.com/2013/08/07/converting-a-wave-file-to-a-flac-file/
[2] http://linux.die.net/man/1/flac
[3] http://linux.die.net/man/1/metaflac
[4] https://www.xiph.org/vorbis/doc/v-comment.html

Advertisements

Converting a Wave File to a FLAC File

A simple Linux command to convert a wave file to a FLAC file:

$ flac -0 --tag=ALBUM="Some Album" --tag=ARTIST="Some Artist" --tag=GENRE="Rock" --tag=TITLE="Song Title" --tag=TRACKNUMBER="3" filename.wav

where filename.wav is the name of the input wave file. The output FLAC file will have the name filename.flac.

Explanation of the command arguments:

-0

Compression level (in this case, 0). Valid compression levels are from 0 to 8.

--tag=ALBUM="Some Album"

Add the ALBUM tag to the FLAC file (in this case, with the value Some Album)

--tag=ARTIST="Some Artist"

Add the ARTIST tag to the FLAC file (in this case, with the value Some Artist)

--tag=GENRE="Rock"

Add the GENRE tag to the FLAC file (in this case, with the value Rock)

--tag=TITLE="Song Title"

Add the TITLE tag to the FLAC file (in this case, with the value Song Title)

--tag=TRACKNUMBER="3"

Add the TRACKNUMBER tag to the FLAC file (in this case, with the value 3)

Note: Valid tags that can be added are TITLE, VERSION, ALBUM, TRACKNUMBER, ARTIST, PERFORMER, COPYRIGHT, LICENSE, ORGANIZATION, DESCRIPTION, GENRE, DATE, LOCATION, CONTACT and ISRC.

Note: flac may not be present in a default installation. It can be installed through the package manager.

References

[1] http://linux.die.net/man/1/flac
[2] https://www.xiph.org/vorbis/doc/v-comment.html