Module Node.Analyser

Analyser nodes.

type opts

The type for AnalyserOptions.

val opts : ?channel_count:int -> ?channel_count_mode:Channel_count_mode.t -> ?channel_interpretation:Channel_interpretation.t -> ?fft_size:int -> ?max_decibels:float -> ?min_decibels:float -> ?smoothing_time_constant:float -> unit -> opts

opts () are analyser node options with given parameters.

type t

The type for AnalyserNode objects.

val create : ?opts:opts -> context -> t

create ~opts c creates an analyser node.

val as_node : t -> node

as_node n is n as an audio node.

val get_float_frequency_data : t -> Brr.Tarray.float32 -> unit

get_float_frequency_data n d copies frequency data into d.

val get_byte_frequency_data : t -> Brr.Tarray.uint8 -> unit

get_byte_frequency_data n d copies frequency data into d.

val get_float_time_domain_data : t -> Brr.Tarray.float32 -> unit

get_float_time_domain_data n d copies time-domain data into d.

val get_byte_time_domain_data : t -> Brr.Tarray.uint8 -> unit

get_byte_frequency_data n d copies time-domain data into d.

Properties

val fft_size : t -> int

fft_size n is the window size of n.

val set_fft_size : t -> int -> unit

set_fft_size n v sets fft_size of n to v.

val frequency_bin_count : t -> int

frequency_bin_count n is the frequency bin count of n.

val min_decibels : t -> float

min_decibels n is the lower bound on results of n.

val set_min_decibels : t -> float -> unit

set_min_decibels n v sets min_decibels of n to v.

val max_decibels : t -> float

max_decibels n is the upper bound on results of n.

val set_max_decibels : t -> float -> unit

set_max_decibels n v sets max_decibels of n to v.

val smoothing_time_constant : t -> float

smoothing_time_constant n is the averaging constant of n.

val set_smoothing_time_constant : t -> float -> unit

set_smoothing_time_constant n v sets smoothing_time_constant of n to v.