Liking cljdoc? Tell your friends :D

dk.simongray.id3

ID3v2 tags, the metadata at the start of MP3 and other audio files.

It reads ID3v2.2, 2.3 and 2.4 as id3.org specifies them, along with the chapters of the Chapter Frame Addendum, and writes 2.3 and 2.4. A tag is a map of its header fields and its :frames. The frames namespace lists the fields of each kind of frame.

Reading is strict. Each accommodation for a tag that breaks the spec is a quirk with an id, and the diagnostics namespace lists them all. The report of a reading names each quirk that applied. To turn quirks off, name them in the :except option.

ID3v2 tags, the metadata at the start of MP3 and other audio files.

It reads ID3v2.2, 2.3 and 2.4 as id3.org specifies them, along with the
chapters of the Chapter Frame Addendum, and writes 2.3 and 2.4. A tag is
a map of its header fields and its :frames. The frames namespace lists
the fields of each kind of frame.

Reading is strict. Each accommodation for a tag that breaks the spec is
a quirk with an id, and the diagnostics namespace lists them all. The
report of a reading names each quirk that applied. To turn quirks off,
name them in the :except option.
raw docstring

(header b)

The header of the ID3v2 tag at the start of b, or nil when b doesn't start with one. It only looks at the first ten bytes.

The header is a map of:

  • :version, e.g. 4 for ID3v2.4, and :revision
  • :flags, the set of flags that are set
  • :size, the size of the tag without its header and footer
  • :end, where the tag ends, after its footer if it has one, which is how many bytes read needs
The header of the ID3v2 tag at the start of `b`, or nil when `b` doesn't
start with one. It only looks at the first ten bytes.

The header is a map of:

- :version, e.g. 4 for ID3v2.4, and :revision
- :flags, the set of flags that are set
- :size, the size of the tag without its header and footer
- :end, where the tag ends, after its footer if it has one, which is
  how many bytes read needs
sourceraw docstring

kindsclj/s

The kinds of frames that have a layout of their own, by id: those in the frames namespace, plus CHAP and CTOC.

The kinds of frames that have a layout of their own, by id: those in the
frames namespace, plus CHAP and CTOC.
sourceraw docstring

readclj/s

(read b)
(read b opts)

The ID3v2 tag at the start of b, read with the opts below, or nil when b doesn't start with one. The tag is its header plus its :frames.

The bytes should hold the whole tag, up to the :end that header returns. If they hold less, it reads the frames that fit. The opts are:

  • :except, the ids of the quirks to turn off
  • :kinds, frame kinds by id, which add to kinds or replace its entries, as the frames namespace describes
The ID3v2 tag at the start of `b`, read with the `opts` below, or nil
when `b` doesn't start with one. The tag is its header plus its :frames.

The bytes should hold the whole tag, up to the :end that header
returns. If they hold less, it reads the frames that fit. The `opts`
are:

- :except, the ids of the quirks to turn off
- :kinds, frame kinds by id, which add to kinds or replace its entries,
  as the frames namespace describes
sourceraw docstring

read-allclj/s

(read-all b)
(read-all b opts)

The ID3v2 tags in a row at the start of b, each read with opts as read takes them, or an empty vector when b doesn't start with a tag. Each tag's :end is where it ends in b, which is where the next one starts.

Some writers put a new tag in front of the old one and leave the old one in place. With the quirk :id3/second-tag, read-all also reads each tag that follows right after the one before.

The ID3v2 tags in a row at the start of `b`, each read with `opts` as
read takes them, or an empty vector when `b` doesn't start with a tag.
Each tag's :end is where it ends in `b`, which is where the next one
starts.

Some writers put a new tag in front of the old one and leave the old one
in place. With the quirk :id3/second-tag, read-all also reads each tag
that follows right after the one before.
sourceraw docstring

reportclj/s

(report tag)

The diagnostics from reading tag, each with its level and message.

The diagnostics from reading `tag`, each with its level and message.
sourceraw docstring

tag-flagsclj/s

The bit of each flag in a tag header, by version.

The bit of each flag in a tag header, by version.
sourceraw docstring

with-tagclj/s

(with-tag b tag)
(with-tag b tag opts)

The bytes of the file b, with its ID3v2 tags replaced by tag, written with opts as write takes them. The audio stays as it is, and so does an ID3v1 tag at the end of the file.

The bytes of the file `b`, with its ID3v2 tags replaced by `tag`, written
with `opts` as write takes them. The audio stays as it is, and so does an
ID3v1 tag at the end of the file.
sourceraw docstring

writeclj/s

(write tag)
(write {:keys [version frames] :or {version 4} :as tag}
       {:keys [padding] :or {padding 0} :as opts})

The bytes of tag, a map of a :version and :frames as read returns it, written with the opts below.

The :version is 3 for ID3v2.3, or 4 for ID3v2.4, which is the default. The frames namespace describes the fields of each kind of frame. A frame of a kind that the library doesn't parse is written from its :data. The opts are:

  • :padding, the number of zero bytes after the frames, 0 by default. Padding leaves room to change the tag later without moving the audio.
  • :kinds, frame kinds by id, which add to kinds or replace its entries

It throws when the tag can't be written, e.g. for an id of ID3v2.2 or a string with a null character. The data of the exception has the :type :dk.simongray.id3/unwritable, and the id of the :frame.

The bytes of `tag`, a map of a :version and :frames as read returns it,
written with the `opts` below.

The :version is 3 for ID3v2.3, or 4 for ID3v2.4, which is the default.
The frames namespace describes the fields of each kind of frame. A frame
of a kind that the library doesn't parse is written from its :data. The
`opts` are:

- :padding, the number of zero bytes after the frames, 0 by default.
  Padding leaves room to change the tag later without moving the audio.
- :kinds, frame kinds by id, which add to kinds or replace its entries

It throws when the tag can't be written, e.g. for an id of ID3v2.2 or
a string with a null character. The data of the exception has the
:type :dk.simongray.id3/unwritable, and the id of the :frame.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close