Module Vorbis.Encoder


module Encoder: sig .. end

type t 
Internal state of an encoder.
val create : int -> int -> int -> int -> int -> t
create chans rate max_br nom_br min_br creates a new encoder with chans channels, with sample rate rate Hz and with respectively max_br, nom_br and min_br as maximal, nominal and minimal bitrates (in bps).
val create_vbr : int -> int -> float -> t
create_vbr chans rate quality creates a new encoder in variable bitrate with chans channels, with sample rate rate Hz and with quality quality, which should be between -1 and 1 (1 is the best).
val reset : t -> unit
val headerout : t -> Ogg.Stream.t -> (string * string) list -> unit
Encode a header given a list of tags.
val headerout_packetout : t ->
(string * string) list ->
Ogg.Stream.packet * Ogg.Stream.packet * Ogg.Stream.packet
Encoder a header, but do not submit packet to Ogg Stream. Usefull when multiplexing ogg streams since the all first packets of each streams must be packed in the initial pages.
val encode_buffer_float : t -> Ogg.Stream.t -> float array array -> int -> int -> unit
Encode a buffer of PCM data.
val time_of_granulepos : t -> Int64.t -> Nativeint.t
Convert a granulepos to absolute time in seconds. The granulepos is interpreted in the context of a given encoder, and gives the end time of a frame's presentation as used in Ogg mux ordering.
val end_of_stream : t -> Ogg.Stream.t -> unit