Module Vorbis


module Vorbis: sig .. end
Decode from or encode to the Ogg Vorbis compressed audio format; or get informations about an Ogg Vorbis file.


Author(s): Samuel Mimram, Julien Cristau, David Baelde



Exceptions


exception Invalid_parameters
Some parameters are invalid for this function.
exception Invalid_quality
The given quality in invalid.
exception Invalid_bitrate
The given bitrate is invalid.
exception Invalid_channels
The given number of channels is invalid.
exception Invalid_sample_freq
The given sampling frequency is invalid.
exception Invalid_argument
Invalid setup request, e.g. out of range argument.
exception Could_not_open_file
The given file could not be opened.
exception Not_vorbis
Bitstream is not Vorbis data.
exception Bad_header
Invalid Vorbis bitstream header.
exception Read_error
A read from media returned an error.
exception Internal_fault
Internal logic fault; indicates a bug or heap/stack corruption.
exception Hole_in_data
Indicates there was an interruption in the data (one of: garbage between pages, loss of sync followed by recapture, or a corrupt page).
exception Bad_link
Indicates that an invalid stream section was supplied, or the requested link is corrupt.
exception Version_mismatch
Invalid Vorbis bitstream header.
exception Not_implemented
Unimplemented mode.
exception Unknown_error of int
An unknown error happened (it should not have happened, please report).
exception Utf8_failure of string
Error while converting utf8.

Useful types


type bitstream = int 
Index of a logical bitstream. The special value -1 means the physical bitsream.

type info = {
   vorbis_version : int; (*version of vorbis codec, must be 0*)
   audio_channels : int; (*number of audio channels*)
   audio_samplerate : int; (*samplerate in Hertz*)
   bitrate_upper : int;
   bitrate_nominal : int;
   bitrate_lower : int;
   bitrate_window : int;
}
Vorbis informations about a file.

Operations with vorbis files



Encoding


val tags : ?title:string ->
?artist:string ->
?genre:string ->
?date:string ->
?album:string ->
?tracknumber:string -> ?comment:string -> unit -> (string * string) list
Create a list of vorbis tags.
module Encoder: sig .. end

Decoding


module Decoder: sig .. end