Module Aacplus

module Aacplus: sig .. end
AAC+ encoding module for OCaml


Usage



Typical use of the encoding modules is:

 (* Define the encoding parameters: *)
 let channels = (..) in
 let samplerate = (..) in
 (* Bitrate is in bps (e.g. 64000) *)
 let bitrate = (..) in 
 (* Create an encoder *)
 let enc = Aacplus.create ~channels ~samplerate ~bitrate () in
 (* Get the frame size *)
 let samples = Aacplus.frame_size enc in
 (* Encode some data *)
 let data = (..some float array array value..) in
 let ret = Aacplus.encode enc data in
 (..do something with encoded data..)
 (..repeat encoding process..)

Remarks:



Types


type t 
Type of an encoder

Exceptions


exception Invalid_data
Raised when submiting invalid data for encoding
exception Invalid_config
Raised when a requesting an invalid encoding configuration.

Functions


val create : channels:int -> samplerate:int -> bitrate:int -> unit -> t
Create an encoder

Raises Invalid_config if encoding parameters cannot be used by the library.

val frame_size : t -> int
Return the number of samples required for each channel of data submited for encoding
val encode : t -> float array array -> string
Encode some audio data.

Raises Invalid_data if submited data does not have the number of channels given when initiating the encoder or does not have the number of samples returned by frame_size in each channel.