Mm_audio.AudioOperations on audio data.
At given sample rate, number of samples in given amount of time.
At given sample rate, duration of given number of samples.
module Sample : sig ... endOperations on samples.
module Note : sig ... endOperations on notes.
module Mono : sig ... endOperations on mono buffers (with only one channel).
type buffer = tval create : int -> int -> tcreate chans len creates a buffer with chans channels and len samples as duration.
val make : int -> int -> float -> tval length : t -> intLength in samples.
Create a buffer with the same number of channels and duration as the given buffer.
val clear : t -> int -> int -> unitClear the buffer (sets all the samples to zero).
val channels : t -> intConvert a buffer to a mono buffer by computing the mean of all channels.
Convert a mono buffer into a buffer. Notice that the original mono buffer is not copied an might thus be modified afterwards.
module U8 : sig ... endmodule S16LE : sig ... endmodule S16BE : sig ... endmodule S24LE : sig ... endmodule S32LE : sig ... endmodule FLTP : sig ... endval clip : t -> int -> int -> unitval noise : t -> int -> int -> unitval squares : t -> int -> int -> floatval copy_to_ba :
t ->
int ->
int ->
(float, Stdlib.Bigarray.float32_elt, Stdlib.Bigarray.c_layout)
Stdlib.Bigarray.Array1.t
array ->
unitval copy_from_ba :
(float, Stdlib.Bigarray.float32_elt, Stdlib.Bigarray.c_layout)
Stdlib.Bigarray.Array1.t
array ->
t ->
int ->
int ->
unitval of_ba :
(float, Stdlib.Bigarray.float32_elt, Stdlib.Bigarray.c_layout)
Stdlib.Bigarray.Array1.t
array ->
tval to_ba :
t ->
int ->
int ->
(float, Stdlib.Bigarray.float32_elt, Stdlib.Bigarray.c_layout)
Stdlib.Bigarray.Array1.t
arrayval copy_to_int16_ba :
t ->
int ->
int ->
(int, Stdlib.Bigarray.int16_signed_elt, Stdlib.Bigarray.c_layout)
Stdlib.Bigarray.Array1.t
array ->
unitval copy_from_int16_ba :
(int, Stdlib.Bigarray.int16_signed_elt, Stdlib.Bigarray.c_layout)
Stdlib.Bigarray.Array1.t
array ->
t ->
int ->
int ->
unitval of_int16_ba :
(int, Stdlib.Bigarray.int16_signed_elt, Stdlib.Bigarray.c_layout)
Stdlib.Bigarray.Array1.t
array ->
tval to_int16_ba :
t ->
int ->
int ->
(int, Stdlib.Bigarray.int16_signed_elt, Stdlib.Bigarray.c_layout)
Stdlib.Bigarray.Array1.t
arrayval amplify : float -> t -> int -> int -> unitAmplify a portion of the buffer by a given coefficient.
val pan : float -> t -> int -> int -> unitPan a stereo buffer from left to right (the buffer should have exactly two channels!). The coefficient should be between -1. and 1..
Add two buffers of the same length, storing the result in the first one.
Add to the first buffer, the second buffer multiplied by a coefficient.
module Buffer_ext : sig ... endBuffers of variable size. These are particularly useful for temporary buffers.
module Ringbuffer : sig ... endCircular ringbuffers.
module Ringbuffer_ext : sig ... endExtensible ringbuffers.
module Analyze : sig ... endmodule Effect : sig ... endAudio effects.
module Generator : sig ... endSound generators.
module IO : sig ... endOperation for reading and writing audio data from files, streams or devices.