package portaudio_c_bindings

  1. Overview
  2. Docs
module C_ffi = Portaudio_ffi

Most functions in this module follow from PortAudio Doxygen as they are thin wrappers over the base PortAudio C library.

module SampleFormat : sig ... end
module PaError = C_ffi.PaError
exception PortAudio_exn of PaError.t * string
type device_index
type pa_time = float
module StreamParameters : sig ... end
module View : sig ... end

This module is a thin wrapper around Ctypes.CArray.t so you should be careful how you use values of this type. It's mostly to avoid copying during the PortAudio callbacks. If you need to keep data around after the callback, copy it into another array that you manage.

module Stream : sig ... end
val initialize : ?terminate_on_exn:bool -> unit -> unit
  • parameter terminate_on_exn

    if true will raise PortAudio_exn with information about what failed.

val terminate : unit -> unit
val sleep : int -> unit
val sample_size : ('a, 'b, 'c) SampleFormat.t -> int
module VersionInfo : sig ... end
module HostApiTypeId = C_ffi.HostApiTypeId
module HostApiInfo : sig ... end
module DeviceInfo : sig ... end
val get_version : unit -> int
val get_version_text : unit -> string
val get_version_info : unit -> VersionInfo.t
val get_error_text : PaError.t -> string
val get_host_api_count : unit -> int
val get_default_host_api : unit -> device_index
val get_host_api_info : device_index -> HostApiInfo.t option
val host_api_type_id_to_host_api_index : HostApiTypeId.t -> device_index option
val get_device_count : unit -> int
val get_default_input_device : unit -> device_index
val get_default_output_device : unit -> device_index
val get_device_info : device_index -> DeviceInfo.t
val get_device_index : int -> device_index option
val is_format_supported : ('a, 'b, 'c) StreamParameters.t -> ('a, 'b, 'c) StreamParameters.t -> sample_rate:float -> (unit, PaError.t) Result.t
OCaml

Innovation. Community. Security.