package ao

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

OCaml interface to the ao library.

type t

Device type.

type driver_kind_t = [
  1. | `LIVE
  2. | `FILE
  3. | `UNKNOWN
]

Which kind of driver?

type byte_format_t = [
  1. | `LITTLE_ENDIAN
  2. | `BIG_ENDIAN
  3. | `NATIVE
  4. | `UNKNOWN
]

Byte format specifier.

type driver_t = private {
  1. id : int;
  2. kind : driver_kind_t;
  3. short_name : string;
  4. name : string;
  5. comment : string;
  6. author : string;
  7. priority : int;
  8. preferred_byte_format : byte_format_t;
  9. options : string list;
}

Driver type (private).

exception Closed

Raised when trying to play or close * a closed device.

exception Invalid_value

Raised when passing an invalid parameter's value.

val get_default_driver : unit -> driver_t

Get default driver

val drivers : driver_t list

drivers is a list of available drivers.

val open_live : ?bits:int -> ?rate:int -> ?channels:int -> ?channels_matrix:string -> ?byte_format:byte_format_t -> ?options:(string * string) list -> ?driver:driver_t -> unit -> t

open_live. * The channels_matrix parameter is * used only if the module is compiled against * libao >= 1.0.

val open_file : ?bits:int -> ?rate:int -> ?channels:int -> ?channels_matrix:string -> ?byte_format:byte_format_t -> ?options:(string * string) list -> ?driver:driver_t -> ?overwrite:bool -> string -> t

open_file. * The channels_matrix parameter is * used only if the module is compiled against * libao >= 1.0.

val find_driver : string -> driver_t

find_driver name returns the driver associated with the given short * name.

val play : t -> string -> unit

play device buf plays the sequence of samples in buf.

val close : t -> unit

close device closes the given device.

Backward compatibility functions, do not use them in new code.

val driver_kind : driver_t -> driver_kind_t
val driver_name : driver_t -> string
val driver_short_name : driver_t -> string
val driver_comment : driver_t -> string
val driver_author : driver_t -> string
val driver_priority : driver_t -> int
val driver_preferred_byte_format : driver_t -> byte_format_t
val driver_options : driver_t -> string list
OCaml

Innovation. Community. Security.