package vorbis

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type t

Internal state of a decoder.

val create : (int -> string * int) -> (int -> Unix.seek_command -> int) -> (unit -> int) -> t

create read_func seek_func tell_func params opens a * stream like openfile for decoding but callbacks are used to * manipulate the data. read_func should return the requested amount of bytes * (or less if it is the end of file), seek_funk should return 0 if the seek * was ok or -1 if the stream is not seekable, tell_func should return the current * offset or -1 if there is no notion of offset in the stream. * Raises: Read_error, Not_vorbis, Version_mismatch, Bad_header, Internal_fault.

val openfile : string -> t * Unix.file_descr

Open a vorbis file for decoding.

val openfile_with_fd : Unix.file_descr -> t
val decode_float : t -> float array array -> int -> int -> int

decode_float dec buff ofs len decodes len samples in each channel and puts * the result in buff starting at position ofs. *

  • raises Hole_in_data

    if there was an interruption of the data. *

    @raise Invalid_parameters

    if all the data cannot fit in the buffer starting at the given position.

val decode_float_alloc : t -> int -> float array array
val decode : t -> ?big_endian:bool -> ?sample_size:int -> ?signed:bool -> bytes -> int -> int -> int

Same as decode_float but decodes to integers.

val streams : t -> int

Get the number of logical bitstreams within a physical bitstream.

val bitstream : t -> bitstream

Get the index of the sequential logical bitstream currently being decoded * (incremented at chaining boundaries even for non-seekable streams). For * seekable streams, it represents the actual chaining index within the * physical bitstream.

val comments : t -> bitstream -> string * (string * string) list

Get the vorbis comments from a vorbis file. The second argument is the * number of the logical bitstream (the current bitstream is used if it is set * to None).

val info : t -> bitstream -> info

Get the vorbis information from the stream header of a bitstream.

val bitrate : t -> bitstream -> int

Get the bitrate of a bitsream (in bps).

val samples : t -> bitstream -> int

Get the total pcm samples of a bitstream.

val duration : t -> bitstream -> float

Get the duration in seconds of a bitstream.

val serialnumber : t -> bitstream -> int

Get the serial number of a bitstream.

OCaml

Innovation. Community. Security.