Module Fdkaac.Encoder

AAC encoding module for OCaml

Exceptions

exception Invalid_handle
exception Unsupported_parameter
exception Invalid_config
exception Error of int
exception End_of_file
exception Unknown of int
val string_of_exception : exn -> string option

Types

type t
type mpeg2_aac = [
  1. | `AAC_LC
  2. | `HE_AAC
  3. | `HE_AAC_v2
]
type mpeg4_aac = [
  1. | mpeg2_aac
  2. | `AAC_LD
  3. | `AAC_ELD
]
type aot = [
  1. | `Mpeg_4 of mpeg4_aac
  2. | `Mpeg_2 of mpeg2_aac
]
type bitrate_mode = [
  1. | `Constant
  2. | `Full_bitreservoir
  3. | `Variable of int
]

VBR modes gives roughly the following bit rates per channel: * * VBR | kbps/channel | AOTs * ------------------------- * 1 | 20-32 | LC,HE,HEv2 * 2 | 32-40 | LC,HE,HEv2 * 3 | 48-56 | LC,HE,HEv2 * 4 | 64-72 | LC * 5 | 96-112 | LC * * HE bit rates will be much lower.

type transmux = [
  1. | `Raw
  2. | `Adif
  3. | `Adts
  4. | `Latm
  5. | `Latm_out_of_band
  6. | `Loas
]
type param_name = [
  1. | `Aot
  2. | `Bitrate
  3. | `Bitrate_mode
  4. | `Samplerate
  5. | `Sbr_mode
  6. | `Granule_length
  7. | `Afterburner
  8. | `Bandwidth
  9. | `Transmux
]
type param = [
  1. | `Aot of aot
  2. | `Bitrate of int
  3. | `Bitrate_mode of bitrate_mode
  4. | `Samplerate of int
  5. | `Sbr_mode of bool
  6. | `Granule_length of int
  7. | `Afterburner of bool
  8. | `Bandwidth of int
  9. | `Transmux of transmux
]

Functions

val create : int -> t
val set : t -> param -> unit
val get : t -> param_name -> param
val encode : t -> string -> int -> int -> string
val flush : t -> string