package portaudio
Install
Dune Dependency
Authors
Maintainers
Sources
md5=88990ca94141e132a816c704a3100bbb
sha512=9f292e7e9dc073472488eff97e28ddc538a6f6f6fcfd2bbdc94d0fe7a40c94c0c30685c26df96eb7a9e1b6ceac933ec0fde6779322b8649adecd248ca4f41379
doc/portaudio/Portaudio/index.html
Module Portaudio
Source
* Bindings for the portaudio portable audio library. * *
*
Exceptions
An error occured. In the future, this exception should be replaced by more * specific exceptions. Use string_of_error
to get a description of the * error.
An unanticipaced
Get a description of an error.
Get the last errror which occured together with its description.
General
Version of portaudio.
Version of portaudio.
Initialize the portaudio library. Should be called before calling any other * function.
Stop using the library. This function should be called before ending the * program and no other portaudio function should be called after.
Host API
type host_api_info = {
h_struct_version : int;
h_host_api_type : int;
h_name : string;
h_device_count : int;
h_default_input_device : int;
h_default_output_device : int;
}
Host API Information
Number of available host API.
Index of the default host API.
Information on a host API
type device_info = {
d_struct_version : int;
d_name : string;
d_host_api : int;
d_max_input_channels : int;
d_max_output_channels : int;
d_default_low_input_latency : float;
d_default_low_output_latency : float;
d_default_high_input_latency : float;
d_default_high_output_latency : float;
d_default_sample_rate : float;
}
Device Information
Default input device.
Default output device.
Number of available devices.
Information on device
Streams
The abstract type ('a, 'b) sample_format
describes the OCaml type 'a
and the underlying C type 'b
used to represent the data being written to or read from a stream. This type is compatible with ('a, 'b) Bigarray.kind
.
The stream uses floats in the range of -1.,1.
to represent audio data. * The underlying type is a 32 bit float.
type ('a, 'b) stream_parameters = {
channels : int;
device : int;
sample_format : ('a, 'b) sample_format;
latency : float;
}
type ('a, 'b, 'c, 'd) callback =
('a, 'b, Bigarray.c_layout) Bigarray.Genarray.t ->
('c, 'd, Bigarray.c_layout) Bigarray.Genarray.t ->
int ->
int
The function signature of a callback. Callbacks only work with interleaved streams.
val open_stream :
('a, 'b) stream_parameters option ->
('c, 'd) stream_parameters option ->
?interleaved:bool ->
float ->
int ->
?callback:('a, 'b, 'c, 'd) callback ->
stream_flag list ->
('a, 'b, 'c, 'd) stream
open_stream inparam outparam interleaved rate bufframes callback flags
opens a new * stream with input stream of format inparam
, output stream of format * outparam
using interleaved or non-interleaved interleaved
buffers * at rate
samples per second, with bufframes
frames per buffer * passed the callback function callback
(0 means leave this choice to * portaudio).
val open_default_stream :
?callback:('a, 'b, 'a, 'b) callback ->
?format:('a, 'b) sample_format ->
?interleaved:bool ->
int ->
int ->
int ->
int ->
('a, 'b, 'a, 'b) stream
open_default_stream callback format interleaved inchans outchans rate bufframes
* opens default stream with callback
as callback function, handling samples in * format
format using interleaved or non-interleaved buffers interleaved
with * inchans
input channels and outchans
output channels * at rate
samples per seconds with handling buffers of size bufframes
.
Sleep.
Write to a stream.
Read from a stream.
val write_stream_ba :
('a, 'b, 'c, 'd) stream ->
('c, 'd, Bigarray.c_layout) Bigarray.Genarray.t ->
int ->
int ->
unit
Write to a stream using a bigarray.
val read_stream_ba :
('a, 'b, 'c, 'd) stream ->
('a, 'b, Bigarray.c_layout) Bigarray.Genarray.t ->
int ->
int ->
unit
Read from a stream using a bigarray.