Membrane.AudioMixer (Membrane Audio Mix plugin v0.3.0) View Source

This element performs audio mixing.

Audio format can be set as an element option or received through caps from input pads. All received caps have to be identical and match ones in element option (if that option is different from nil).

Input pads can have offset - it tells how much silence should be added before first sample from that pad. Offset has to be positive.

Mixer mixes only raw audio (PCM), so some parser may be needed to precede it in pipeline.

Element options

Passed via struct Membrane.AudioMixer.t/0

  • caps

    Raw.t()

    Default value: nil
    The value defines a raw audio format of pads connected to the element. It should be the same for all the pads.

  • frames_per_buffer

    pos_integer()

    Default value: 2048
    Assumed number of raw audio frames in each buffer. Used when converting demand from buffers into bytes.

  • prevent_clipping

    boolean()

    Default value: true
    Defines how the mixer should act in the case when an overflow happens.

Pads

:input

Availability:on_request
CapsMembrane.Caps.Audio.Raw, restrictions:<br />&nbsp;&nbsp;format: one_of([:s8, :s16le, :s16be, :s24le, :s24be, :s32le, :s32be])
Demand unit:bytes
Direction:input
Mode:pull
Name:input

Options:

  • offset

    Time.t()

    Default value: 0
    Offset of the input audio at the pad.

:output

Availability:always
CapsMembrane.Caps.Audio.Raw
Direction:output
Mode:pull
Name:output

Link to this section Summary

Types

Options for pad :input

t()

Struct containing options for Membrane.AudioMixer

Functions

Returns pads descriptions for Membrane.AudioMixer

Returns description of options available for this module

Link to this section Types

Specs

input_pad_opts_t() :: [{:offset, Membrane.Time.t()}]

Options for pad :input

Specs

t() :: %Membrane.AudioMixer{
  caps: Membrane.Caps.Audio.Raw.t(),
  frames_per_buffer: pos_integer(),
  prevent_clipping: boolean()
}

Struct containing options for Membrane.AudioMixer

Link to this section Functions

Specs

membrane_pads() :: [{Membrane.Pad.name_t(), Membrane.Pad.description_t()}]

Returns pads descriptions for Membrane.AudioMixer

Specs

options() :: keyword()

Returns description of options available for this module