package taglib

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Parse and generate id3v2 binary tags. * * This module provides ways to manipulate id3v2 tags * not attached to a file. It is quite low-level and, * despite good care in tightening its API, it is possible * to generate invalid id3v2 tags using it. The user is thus * advised to read about the id3v2 standard before using this * module. * * Currently, only attaching text-based frames are supported. * Reading tag's frames can only be done currently through the * common tag_title, ... API. * * See examples/tagutil.ml for an example of the use of this module.

type state = [
  1. | `Invalid
  2. | `Parsed
  3. | `Valid
]

State of the tag. This is used to enforce validity of * the generated tag. * * A tag is valid iff it has been properly parsed or * at least one frame has been added to it.

type 'a id3v2_tag constraint 'a = [< state ]
type 'a id3v2 = 'a id3v2_tag t
type frame_type = string

A frame type is the id3v2 identifier, e.g. TIT2, TALB, ...

type frame_text = string

Text content of a frame.

val init : unit -> [ `Invalid ] id3v2
val header_size : int
val parse_header : [ `Invalid ] id3v2 -> string -> [ `Parsed ] id3v2
val tag_size : [< `Parsed | `Valid ] id3v2 -> int
val parse_tag : [ `Parsed ] id3v2 -> string -> [ `Valid ] id3v2
val attach_frame : [< `Invalid | `Valid ] id3v2 -> frame_type -> frame_text -> [ `Valid ] id3v2
val render : [ `Valid ] id3v2 -> string

Generic set functions

These functions perform the same operations as their counter-part from Taglib. * The only difference here is that they return a valid tag.

val tag_set_title : [< `Invalid | `Valid ] id3v2 -> string -> [ `Valid ] id3v2
val tag_set_artist : [< `Invalid | `Valid ] id3v2 -> string -> [ `Valid ] id3v2
val tag_set_album : [< `Invalid | `Valid ] id3v2 -> string -> [ `Valid ] id3v2
val tag_set_comment : [< `Invalid | `Valid ] id3v2 -> string -> [ `Valid ] id3v2
val tag_set_genre : [< `Invalid | `Valid ] id3v2 -> string -> [ `Valid ] id3v2
val tag_set_year : [< `Invalid | `Valid ] id3v2 -> int -> [ `Valid ] id3v2
val tag_set_track : [< `Invalid | `Valid ] id3v2 -> int -> [ `Valid ] id3v2
OCaml

Innovation. Community. Security.