package metadata

  1. Overview
  2. Docs

ID3v2 metadata.

val parse : ?recode: (?source:[ `ISO_8859_1 | `UTF_8 | `UTF_16 | `UTF_16LE | `UTF_16BE ] -> ?target:[ `UTF_8 | `UTF_16 | `UTF_16LE | `UTF_16BE ] -> string -> string) -> Metadata__.MetadataBase.Reader.t -> (string * string) list

Parse the ID3v2 header.

val parse_file : ?recode: (?source:[ `ISO_8859_1 | `UTF_8 | `UTF_16 | `UTF_16LE | `UTF_16BE ] -> ?target:[ `UTF_8 | `UTF_16 | `UTF_16LE | `UTF_16BE ] -> string -> string) -> ?custom_parser:(Metadata__.MetadataBase.parser_handler -> unit) -> string -> (string * string) list

Parse the ID3v2 header from a file.

val dump : Metadata__.MetadataBase.Reader.t -> string

Dump the ID3v2 header.

val dump_file : string -> string

Dump the ID3v2 header from a file.

type apic = {
  1. mime : string;
  2. picture_type : int;
  3. description : string;
  4. data : string;
}
type pic = {
  1. pic_format : string;
  2. pic_type : int;
  3. pic_description : string;
  4. pic_data : string;
}
val parse_apic : ?recode: (?source:[ `ISO_8859_1 | `UTF_8 | `UTF_16 | `UTF_16LE | `UTF_16BE ] -> ?target:[ `UTF_8 | `UTF_16 | `UTF_16LE | `UTF_16BE ] -> string -> string) -> string -> apic

Parse an APIC tag (containing album art).

val parse_pic : ?recode: (?source:[ `ISO_8859_1 | `UTF_8 | `UTF_16 | `UTF_16LE | `UTF_16BE ] -> ?target:[ `UTF_8 | `UTF_16 | `UTF_16LE | `UTF_16BE ] -> string -> string) -> string -> pic

Parse a PIC tag (containing album art).

type frame_id = [
  1. | `AENC
  2. | `APIC
  3. | `COMM
  4. | `COMR
  5. | `ENCR
  6. | `EQUA
  7. | `ETCO
  8. | `GEOB
  9. | `GRID
  10. | `IPLS
  11. | `MCDI
  12. | `MLLT
  13. | `OWNE
  14. | `PCNT
  15. | `POPM
  16. | `POSS
  17. | `PRIV
  18. | `RBUF
  19. | `RVAD
  20. | `RVRB
  21. | `SYLT
  22. | `SYTC
  23. | `TALB
  24. | `TBPM
  25. | `TCOM
  26. | `TCON
  27. | `TCOP
  28. | `TDAT
  29. | `TDLY
  30. | `TENC
  31. | `TEXT
  32. | `TFLT
  33. | `TIME
  34. | `TIT1
  35. | `TIT2
  36. | `TIT3
  37. | `TKEY
  38. | `TLAN
  39. | `TLEN
  40. | `TMED
  41. | `TOAL
  42. | `TOFN
  43. | `TOLY
  44. | `TOPE
  45. | `TORY
  46. | `TOWN
  47. | `TPE1
  48. | `TPE2
  49. | `TPE3
  50. | `TPE4
  51. | `TPOS
  52. | `TPUB
  53. | `TRCK
  54. | `TRDA
  55. | `TRSN
  56. | `TRSO
  57. | `TSIZ
  58. | `TSRC
  59. | `TSSE
  60. | `TXXX
  61. | `TYER
  62. | `UFID
  63. | `USER
  64. | `USLT
  65. | `WCOM
  66. | `WCOP
  67. | `WOAF
  68. | `WOAR
  69. | `WOAS
  70. | `WORS
  71. | `WPAY
  72. | `WPUB
  73. | `WXXX
]

Frame identifier.

val string_of_frame_id : frame_id -> string

String representation of a frame identifier.

val frame_id_of_string : string -> frame_id option

Parse a string into a frame id.

val binary_frame : frame_id -> bool

Does a frame contain binary data?

type text_encoding = [
  1. | `ISO_8859_1
  2. | `UTF_16
  3. | `UTF_16BE
  4. | `UTF_16LE
  5. | `UTF_8
]

Charset for encoding text.

type frame_data = [
  1. | `Text of text_encoding * string
  2. | `Binary of string
]

Data contained in a frame.

type frame_flag = [
  1. | `File_alter_preservation of bool
  2. | `Tag_alter_perservation of bool
]
val default_flags : frame_id -> frame_flag list

Default flags for a frame.

type frame = {
  1. id : frame_id;
  2. data : frame_data;
  3. flags : frame_flag list;
}

A ID3 frame.

val make : version:int -> frame list -> string

Create an ID3v2 header. Consistency between frame_id and frame_data is not enforced and left to the user to check.

OCaml

Innovation. Community. Security.