sandreas / tone

tone is a cross platform audio tagger and metadata editor to dump and modify metadata for a wide variety of formats, including mp3, m4b, flac and more. It has no dependencies and can be downloaded as single binary for Windows, macOS, Linux and other common platforms.
https://pilabor.com
Apache License 2.0
421 stars 17 forks source link

Format specification to represent ALL possible metadata fields #13

Closed sandreas closed 2 years ago

sandreas commented 2 years ago

Think over a metadata format (JSON?) that contains all possible metadata fields (JsonMeta) and a container, to wrap this format to contain even more information (file, options, etc.). Additionaly, a parameter --json-path should be implemented, where this output can be queried in dump command (see here), e.g.:

Meta:

{
    "artist": "My Artist",
    "lyrics": {

     }
    "chapters": [ 
        [0, 10000, "chapter title"]
    ],
    "pictures": [{
           "id" : "..",

     }]
}

Container:

{
 "options": {
    "meta-album": "My Album"
  },  
 "file": {
     "size": 800001,
     "path": "/audiobooks",
     "name": "my-audiobook.m4b"
     "created": "2020-08-20T12:34:56Z"
  }
  "meta": {"meta from above"}
}

References:

Chapters - for now start, length and title would be enough

// start
// end / length
// title
// uniqueID (id3 only)
// subtitle (id3 only)
// url (id3 only)
// picture (id3 only)

Pictures - for now data, picType and tagType are enough (position can be calculated automatically?)

public static PictureInfo fromBinaryData(byte[] data, PIC_TYPE picType = PIC_TYPE.Generic, TagType tagType = TagType.ANY, object nativePicCode = null, int position = 1) {
}
sandreas commented 2 years ago

Introduced with v0.0.6 (tone.json).

Main key meta has been implemented. Missing is a main key for the audio and file specific information, e.g.:

{
  "meta": {},
  "audio": {
    "codec": "aac",
    "duration": 834833,
    "format": "mp4",
    "bitrate": 64000
    "samplerate": 44100
  },
  "file": {
    "size": 13255,
    "created": "2020-01-01T12:34:56Z",
    "mimeType": "audio/x-m4b"
  }
}
sandreas commented 2 years ago

fixed with 0.0.8