Module Sample.Ringbuffer

Ringbuffers.

type t = {
  1. mutable buffer : sample array;
  2. mutable pos : int;
}

A ringbuffer.

val create : unit -> t
val prepare : ?init:(unit -> sample) -> t -> int -> unit

Ensure that the buffer can hold this amount of data.

val size : t -> int

Number of sample that the buffer can hold.

val advance : t -> unit

Advance the write cursor by one sample.

val past : t -> int -> sample
val write : t -> sample -> unit