Module Taglib


module Taglib: sig .. end
Ocaml bindings to taglib


This library provides a set/get interface for several audio file format's tags informations.

Usage is quite simple. All functions using a file type variable, except close_file, may raise Closed if given file was closed.

Types


type t 

type file_type =
| Mpeg
| OggVorbis
| Flac
| Mpc
| OggFlac
| WavPack
| Speex
| TrueAudio
| Mp4
| Asf
Supported file types. Warning, types: WavPack, Speex and TrueAudio are only supported in Taglib >= 1.5. Types: Mp4, Asf are only supported with Taglib >= 1.6.
val version : string
Library's version.
exception Closed
Raised when using a file that has been closed
exception Not_implemented
Raised when using a file format not supported by the system's taglib library.

Functions



Settings


val set_strings_unicode : bool -> unit
All strings supplied to the library are supposed to be UTF-8. Set this to true to use strings in latin1 (ISO-8859-1) format

File interface


val open_file : ?file_type:file_type -> string -> t
Open a file.

Raises Not_found if file does not exist or could not be opened.

Raises Not_implemented if using a file_type that is not implemented in the system's taglib library.

val close_file : t -> unit
val file_save : t -> bool

Get tag interface


val tag_title : t -> string
val tag_artist : t -> string
val tag_album : t -> string
val tag_comment : t -> string
val tag_genre : t -> string
val tag_year : t -> int
val tag_track : t -> int

Set tag interface


val tag_set_title : t -> string -> unit
val tag_set_artist : t -> string -> unit
val tag_set_album : t -> string -> unit
val tag_set_comment : t -> string -> unit
val tag_set_genre : t -> string -> unit
val tag_set_year : t -> int -> unit
val tag_set_track : t -> int -> unit

Get audio properties interface


val audioproperties_length : t -> int
val audioproperties_bitrate : t -> int
val audioproperties_samplerate : t -> int
val audioproperties_channels : t -> int