Module Audio.Context

Audio contexts.

Base audio contexts

module State : sig ... end

The context state enumeration.

module Base : sig ... end

Base audio contexts.

Audio contexts

module Latency_category : sig ... end

Audio latency category enumeration.

type opts

The type for AudioContextOptions.

val opts : ?⁠latency_hint:[ `Category of Latency_category.t | `Secs of float ] -> ?⁠sample_rate_hz:float -> unit -> opts

opts () are audio context options with the given properties.

type t

The type for AudioContext objects.

val create : ?⁠opts:opts -> unit -> t

create ~opts () creates an audio context.

val as_target : t -> Brr.Ev.target

as_target c is c as an event target.

val as_base : t -> Base.t

as_base c is c as a base audio context.

val base_latency : t -> float

base_latency c is the base latency of c.

val output_latency : t -> float

output_latency c is the output latency of c.

val get_output_timestamp : t -> Timestamp.t

get_output_timestamp c is the output timestamp of c.

val resume : t -> unit Fut.or_error

resume c resumes progression of time in c.

val suspend : t -> unit Fut.or_error

suspend c suspend progression of time in c.

val close : t -> unit Fut.or_error

close c closes the audio context c.

Offline audio contexts

module Offline : sig ... end

Offline audio contexts.