Liking cljdoc? Tell your friends :D

dk.simongray.podcast.format.media.mp3

MP3 files: the ID3v2 tags at the start, and the MPEG audio frames after them.

ISO/IEC 11172-3 and 13818-3 define the header of a frame, and the reader takes MPEG 2.5 too, which is in neither.

The duration comes from the first of these that the file has:

  • the Xing or Info header, which LAME and most encoders write in the first frame
  • the VBRI header of the Fraunhofer encoder
  • the average bitrate of the first frames and the size of the file, which is exact for a constant bitrate

The reading is strict: the audio starts right after the tags. The quirk :mp3/junk-before-audio skips bytes that are no frame, such as padding that the size of a tag leaves out. The :except option leaves out the quirks that it names, those of the tags too.

MP3 files: the ID3v2 tags at the start, and the MPEG audio frames after
them.

ISO/IEC 11172-3 and 13818-3 define the header of a frame, and the reader
takes MPEG 2.5 too, which is in neither.

The duration comes from the first of these that the file has:

- the Xing or Info header, which LAME and most encoders write in the
  first frame
- the VBRI header of the Fraunhofer encoder
- the average bitrate of the first frames and the size of the file,
  which is exact for a constant bitrate

The reading is strict: the audio starts right after the tags. The quirk
:mp3/junk-before-audio skips bytes that are no frame, such as padding
that the size of a tag leaves out. The :except option leaves out the
quirks that it names, those of the tags too.
raw docstring

frame-headerclj/s

(frame-header view p)

The header of the MPEG audio frame at p in view, or nil when no valid header is there.

The header is a map of :version, :layer, :bitrate, :sample-rate, :samples, :length, :mono? and :crc?. The bitrate is in bit/s, and the length of the frame is in bytes.

The header of the MPEG audio frame at `p` in `view`, or nil when no
valid header is there.

The header is a map of :version, :layer, :bitrate, :sample-rate,
:samples, :length, :mono? and :crc?. The bitrate is in bit/s, and the
length of the frame is in bytes.
sourceraw docstring

readclj/s

(read view)
(read view opts)

The MP3 file in view, read with opts, as a map of the keys below, each absent when the file doesn't have it, as mp4/read gives them.

  • :id3 are the ID3v2 tags, and :tags what they say, as id3/named gives it
  • :media-start is where the first frame starts
  • :sample-rate and :channels of the first frame, and :vbr?, whether a Xing or VBRI header says that the bitrate varies, or false when an Info header says that it doesn't
  • :duration is in seconds, from a Xing, Info or VBRI header, else estimated from the frames and the size of the file, else from the TLEN frame of a tag
  • :chapters, from the CHAP and CTOC frames, as id3/chapters gives them
  • :artwork, a map of :type, :data and :description

The :except of opts is the ids of the quirks to leave out. When the view lacks bytes, the reading throws an exception that holds their ranges.

The MP3 file in `view`, read with `opts`, as a map of the keys below,
each absent when the file doesn't have it, as mp4/read gives them.

- :id3 are the ID3v2 tags, and :tags what they say, as id3/named gives
  it
- :media-start is where the first frame starts
- :sample-rate and :channels of the first frame, and :vbr?, whether a
  Xing or VBRI header says that the bitrate varies, or false when an
  Info header says that it doesn't
- :duration is in seconds, from a Xing, Info or VBRI header, else
  estimated from the frames and the size of the file, else from the TLEN
  frame of a tag
- :chapters, from the CHAP and CTOC frames, as id3/chapters gives them
- :artwork, a map of :type, :data and :description

The :except of `opts` is the ids of the quirks to leave out. When the
view lacks bytes, the reading throws an exception that holds their
ranges.
sourceraw docstring

reportclj/s

(report file)

The diagnostics of the read file, with those of its tags. Each diagnostic has its message.

The diagnostics of the read `file`, with those of its tags. Each
diagnostic has its message.
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