1

Is there a command utility that can convert between various audio formats (or more specifically from wav to flac) while preserving tags? Or an utility that can copy tags from one audio file to another?

There are various tags, not just track name and artist. There are also custom tags (i.e. tags with custom names not commonly found in tag databases).

Tags are generated by different tools and every tool saves tags in different formats. Some tools just make a "LIST" chunk with type "INFO". Other tools also make an "ID3 " or "id3 " chunk with ID3v2 tags inside. Other tools just stick ID3v2 tags to the end of the file without even making a RIFF chunk.

4
  • Does the flac --keep-foreign-metadata option do what you need? If not, please could you describe the "custom tags", and what you want to happen to them, in more detail? Commented Oct 29, 2019 at 14:50
  • No, it does not keep any tags, custom or not. Commented Nov 11, 2019 at 17:32
  • So, it doesn't recognize the kind of tags used in your WAV files. To find a tool that does, we'll need to know more about those tags: Can you include a hexdump of the part of the file containing them? Do you know what tool created them? What software are you using that does recognize them? Commented Nov 11, 2019 at 17:45
  • Every software I use recognizes at least some of the tags. Those tags aren't some 'special' metadata, I call them 'custom' because these tags have custom names, not just 'ARTIST' and 'TITLE'. Tags are generated by different tools and every tool saves tags in different formats. Some tools just make a "LIST" chunk with type "INFO". Other tools also make an "ID3 " or "id3 " chunk with ID3v2 tags inside. Other tools just stick ID3v2 tags to the end of the file without even making a RIFF chunk. Commented Nov 13, 2019 at 4:06

2 Answers 2

4

The standard flac command will perform the re-encoding step:

flac some.wav -o some.flac

For tagging, Kid3 provides a command-line interface, and recognizes tags in WAV files. kid3-cli has its own interactive command interpreter, so to copy tags from one file to another, you could use:

$ kid3-cli
kid3-cli> select some.wav
kid3-cli> copy
kid3-cli> select some.flac
kid3-cli> paste
kid3-cli> save
kid3-cli> exit
$

To use it in a truly command-line, non-interactive manner, such as in a script, you can instead provide each of those steps as a separate -c argument:

kid3-cli -c 'select some.wav' -c copy -c 'select some.flac' -c paste

(The save step is done automatically when providing commands with -c.)

1

Here is how I approached the same problem in Windows:

  1. Download and install FLAC (of course)
  2. Download and install Kid3
  3. Write a foreach loop using the command shell of your choice
    For each ($SRC in $DIR)
      flac $SRC.wav -f --tag="NSTDtag=NSTDvalue"
      kid3-cli.exe -c "select $SRC.wav" -c "copy" -c "select $SRC.flac" -c "paste"
    DONE!
    

Note: For nonstandard tags, you have to get flac to put them in (--tag="NSTDtag=NSTDvalue"); kid3 blows up if it has to write non-standard tags.

Note: Implementation details depend on the environment/shell you are working with

Note: kid3-cli even copies "Picture" tags without a hitch

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.