package metadata

  1. Overview
  2. Docs

Module Metadata.MakeSource

Generate metadata parsers given functions for converting charsets.

Parameters

module _ : CharEncoding.T

Signature

Sourceexception Invalid

Raised when the metadata is not valid.

Sourcetype metadata = (string * string) list

Metadata are represented as association lists (name, value).

Bigarray representation of (large) tags.

Sourcetype parser_handler = {
  1. label : string;
  2. length : int;
  3. read : unit -> string;
  4. read_ba : (unit -> bigarray) option;
  5. skip : unit -> unit;
}

When used, a custom parser can override the default parsing mechanism. It is passed the metadata label (without normalization), the expected length of the data, a regular read function an an optional bigarray read function. The custom parser can call any of the read function to get the corresponding tag's value. After doing so, the tag is ignored by the regular parsing process.

Currently only supported for: ID3v2, MP4 and metadata_block_picture in FLAC metadata.

Sourcetype custom_parser = parser_handler -> unit

A custom parser, see parser_handler.

Sourcemodule Reader : sig ... end

Abstractions for reading from various sources.

Sourcemodule ID3v1 : sig ... end

ID3v1 metadata.

Sourcemodule ID3v2 : sig ... end

ID3v2 metadata.

Sourcemodule OGG : sig ... end

OGG metadata.

Sourcemodule FLAC : sig ... end

Flac metadata.

Sourcemodule JPEG : sig ... end

Jpeg metadata.

Sourcemodule PNG : sig ... end

PNG metadata.

Sourcemodule AVI : sig ... end

AVI metadata.

Sourcemodule MP4 : sig ... end

MP4 metadata.

Sourcemodule WAV : sig ... end

WAV metadata.

Sourcemodule RIFF : sig ... end

RIFF metdata.

Sourceval recode : ?source:[ `ISO_8859_1 | `UTF_16 | `UTF_16BE | `UTF_16LE | `UTF_8 ] -> ?target:[ `UTF_16 | `UTF_16BE | `UTF_16LE | `UTF_8 ] -> string -> string

Convert the charset encoding of a string.

Sourcemodule ID3 : sig ... end

ID3v1 and ID3v2 metadata.

Sourceval first_valid : (Reader.t -> metadata) list -> Reader.t -> metadata

Return the first application which does not raise invalid.

Sourcemodule Audio : sig ... end

Audio file formats.

Sourcemodule Image : sig ... end

Image file formats.

Sourcemodule Video : sig ... end

Video file formats.

Sourcemodule Any : sig ... end

All supported file formats.

include module type of Any
Sourceval parse : Reader.t -> (string * string) list

Generic metadata parsing.

Sourceval parse_file : ?custom_parser:custom_parser -> string -> (string * string) list

Parse the metadata from a file.

Sourceval parse_string : ?custom_parser:custom_parser -> string -> (string * string) list

Parse the metadata from a string containing the contents of a file.