package otaglibc

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

Module OtaglibcSource

Ocaml bindings to taglib C API.

This bindings don't expose taglib complex properties but provide some functions to handle pictures.

Sourcetype t

taglib file

Sourcetype id3v2_encoding =
  1. | ID3v2_Latin
  2. | ID3v2_UTF16
  3. | ID3v2_UTF16BE
  4. | ID3v2_UTF8
Sourcetype file_type =
  1. | MPEG
  2. | OggVorbis
  3. | FLAC
  4. | MPC
  5. | OggFlac
  6. | WavPack
  7. | Speex
  8. | TrueAudio
  9. | MP4
  10. | ASF
  11. | AIFF
  12. | WAV
  13. | APE
  14. | IT
  15. | Mod
  16. | S3M
  17. | XM
  18. | Opus
  19. | DSF
  20. | DSDIFF
  21. | SHORTEN
Sourcetype audioproperties = {
  1. bitrate : int;
  2. channels : int;
  3. length : int;
  4. samplerate : int;
}

Audioproperties type

Sourcetype picture = {
  1. mime_type : string;
  2. description : string;
  3. picture_type : string;
  4. data : bytes;
}

Picture type

Sourceval from_filename : string -> t option

from_filename creates a taglib file from filename. Returns None if the file type cannot be determined, the file cannot be opened or is not valid.

Sourceval from_filename_with_type : string -> file_type -> t option

from_filename_with_type is like from_filename but takes the filetype has parameter instead of guessing it.

Sourceval with_open : string -> (t -> 'a) -> 'a option

with_open filename f is file |> from_filename |> Option.map (fun taglib -> f taglib)

Sourceval with_open_with_type : string -> file_type -> (t -> 'a) -> 'a option

with_open_with_type filename filetype f is Option.map f (from_filename_with_type file type')

Sourceval set_strings_unicode : bool -> unit
Sourceval title : t -> string option
Sourceval set_title : t -> string -> unit
Sourceval album : t -> string option
Sourceval set_album : t -> string -> unit
Sourceval artist : t -> string option
Sourceval set_artist : t -> string -> unit
Sourceval genre : t -> string option
Sourceval set_genre : t -> string -> unit
Sourceval comment : t -> string option
Sourceval set_comment : t -> string -> unit
Sourceval year : t -> int
Sourceval set_year : t -> int -> unit
Sourceval track : t -> int
Sourceval set_track : t -> int -> unit
Sourceval save : t -> bool
Sourceval id3v2_set_default_text_encoding : id3v2_encoding -> unit
Sourceval audioproperties : t -> audioproperties option
Sourceval property_keys : t -> string array option
Sourceval property : t -> string -> string array option
Sourceval set_property : t -> string -> string -> unit
Sourceval set_property_append : t -> string -> string -> unit
Sourceval property_clear : t -> string -> unit
Sourceval set_properties : t -> string -> string list -> unit

set_properties taglib key values clears all properties associated with key before setting values for key.

Sourceval add_picture : t -> picture -> unit

add_picture taglib picture adds picture associated with the complex property PICTURE

Sourceval remove_pictures : t -> unit

remove_pictures taglib removes all values associated with the complex property PICTURE

Sourceval pictures : t -> picture array

pictures taglib returns all pictures associated with the complex property PICTURE