package mm

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Mm_audio.AudioSource

Operations on audio data.

Sourceval samples_of_seconds : int -> float -> int

At given sample rate, number of samples in given amount of time.

Sourceval seconds_of_samples : int -> int -> float

At given sample rate, duration of given number of samples.

Sourceval lin_of_dB : float -> float

Convert decibels to linear coefficient.

Sourceval dB_of_lin : float -> float

Convert linear coefficient to decibels.

Sourcemodule Sample : sig ... end

Operations on samples.

Sourcemodule Note : sig ... end

Operations on notes.

Sourcemodule Mono : sig ... end

Operations on mono buffers (with only one channel).

Sourcetype t = float array array

An audio buffer.

Sourcetype buffer = t
Sourceval create : int -> int -> t

create chans len creates a buffer with chans channels and len samples as duration.

Sourceval make : int -> int -> float -> t
Sourceval length : t -> int

Length in samples.

Sourceval create_same : t -> t

Create a buffer with the same number of channels and duration as the given buffer.

Sourceval clear : t -> int -> int -> unit

Clear the buffer (sets all the samples to zero).

Sourceval copy : t -> int -> int -> t

Copy the given buffer.

Sourceval append : t -> int -> int -> t -> int -> int -> t
Sourceval channels : t -> int
Sourceval to_mono : t -> int -> int -> Mono.t

Convert a buffer to a mono buffer by computing the mean of all channels.

Sourceval of_mono : Mono.t -> t

Convert a mono buffer into a buffer. Notice that the original mono buffer is not copied an might thus be modified afterwards.

Sourceval interleave : t -> int -> int -> Mono.t
Sourceval deinterleave : int -> Mono.t -> int -> int -> t
Sourcemodule U8 : sig ... end
Sourcemodule S16LE : sig ... end
Sourcemodule S16BE : sig ... end
Sourcemodule S24LE : sig ... end
Sourcemodule S32LE : sig ... end
Sourcemodule FLTP : sig ... end
Sourceval resample : ?mode:[ `Nearest | `Linear ] -> float -> t -> int -> int -> t
Sourceval blit : t -> int -> t -> int -> int -> unit
Sourceval sub : t -> int -> int -> t
Sourceval clip : t -> int -> int -> unit
Sourceval noise : t -> int -> int -> unit
Sourceval squares : t -> int -> int -> float
Sourceval copy_to_ba : t -> int -> int -> (float, Bigarray.float32_elt, Bigarray.c_layout) Bigarray.Array1.t array -> unit
Sourceval copy_from_ba : (float, Bigarray.float32_elt, Bigarray.c_layout) Bigarray.Array1.t array -> t -> int -> int -> unit
Sourceval to_ba : t -> int -> int -> (float, Bigarray.float32_elt, Bigarray.c_layout) Bigarray.Array1.t array
Sourceval copy_to_int16_ba : t -> int -> int -> (int, Bigarray.int16_signed_elt, Bigarray.c_layout) Bigarray.Array1.t array -> unit
Sourceval copy_from_int16_ba : (int, Bigarray.int16_signed_elt, Bigarray.c_layout) Bigarray.Array1.t array -> t -> int -> int -> unit
Sourceval to_int16_ba : t -> int -> int -> (int, Bigarray.int16_signed_elt, Bigarray.c_layout) Bigarray.Array1.t array
Sourceval amplify : float -> t -> int -> int -> unit

Amplify a portion of the buffer by a given coefficient.

Sourceval pan : float -> t -> int -> int -> unit

Pan a stereo buffer from left to right (the buffer should have exactly two channels!). The coefficient should be between -1. and 1..

Sourceval add : t -> int -> t -> int -> int -> unit

Add two buffers of the same length, storing the result in the first one.

Sourceval add_coeff : t -> int -> float -> t -> int -> int -> unit

Add to the first buffer, the second buffer multiplied by a coefficient.

Sourcemodule Buffer_ext : sig ... end

Buffers of variable size. These are particularly useful for temporary buffers.

Sourcemodule Ringbuffer : sig ... end

Circular ringbuffers.

Sourcemodule Ringbuffer_ext : sig ... end

Extensible ringbuffers.

Sourcemodule Analyze : sig ... end
Sourcemodule Effect : sig ... end

Audio effects.

Sourcemodule Generator : sig ... end

Sound generators.

Sourcemodule IO : sig ... end

Operation for reading and writing audio data from files, streams or devices.

OCaml

Innovation. Community. Security.