Module Jack.Ringbuffer

type t
val create : int -> t
val mlock : t -> unit
val read : t -> bytes -> int -> int -> int
val read_space : t -> int
val write : t -> bytes -> int -> int -> int
val write_space : t -> int
val read_to_ba : t -> buffer -> int -> int -> int

Read from the ringbuffer into a float32 Bigarray. Offset and count are in samples (float32 units). Returns the number of samples read.

val read_alloc : t -> float array

Read all available data from the ringbuffer into a freshly allocated float64 OCaml array, converting from float32.

val read_to_buffer : t -> float array -> int -> int -> int

Read from the ringbuffer into a float64 OCaml array, converting from float32. Offset and count are in samples. Returns the number of samples read.

val write_from_ba : t -> buffer -> int -> int -> int

Write from a float32 Bigarray into the ringbuffer. Offset and count are in samples (float32 units). Returns the number of samples written.

val write_from_buffer : t -> float array -> int -> int -> int

Write from a float64 OCaml array into the ringbuffer, converting to float32. Offset and count are in samples. Returns the number of samples written.

val read_advance : t -> int -> unit

Advance the read pointer by n bytes without reading the data.