View Source Membrane.AudioMixerBin (Membrane Audio Mix plugin v0.8.1)
Bin element distributing a mixing job between multiple Membrane.AudioMixer
elements.
A tree of AudioMixers is created according to max_inputs_per_node
parameter:
- if number of input tracks is smaller than
max_inputs_per_node
, only one AudioMixer element is created for the entire job - if there are more input tracks than
max_inputs_per_node
, there are created enough mixers so that each mixer has at mostmax_inputs_per_node
inputs - outputs from those mixers are then mixed again following the same rules - another level of mixers is created having enough mixers so that each mixer on this level has at mostmax_inputs_per_node
inputs (those are now the outputs of the previous level mixers). Levels are created until only one mixer in the level is needed - output from this mixer is the final mixed track.
Bin allows for specifying options for Membrane.AudioMixer
, which are applied for all AudioMixers.
Recommended to use in case of mixing jobs with many inputs.
bin-options
Bin options
Passed via struct Membrane.AudioMixerBin.t/0
max_inputs_per_node
pos_integer()
Default value:
10
The maximum number of inputs to a single mixer in the mixers tree. Must be at least 2.mixer_options
AudioMixer.t()
Default value:
%Membrane.AudioMixer{caps: nil, frames_per_buffer: 2048, native_mixer: false, prevent_clipping: true}
The options that would be passed to each created AudioMixer.
pads
Pads
input
:input
Availability | :on_request |
Caps | Membrane.RawAudio , restrictions:sample_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
:output
Availability | :always |
Caps | Membrane.RawAudio |
Demand unit | :bytes |
Direction | :output |
Mode | :pull |
Name | :output |
Link to this section Summary
Functions
Returns pads descriptions for Membrane.AudioMixerBin
Returns description of options available for this module
Link to this section Types
@type input_pad_opts_t() :: [{:offset, Time.t()}]
Options for pad :input
@type t() :: %Membrane.AudioMixerBin{ max_inputs_per_node: pos_integer(), mixer_options: Membrane.AudioMixer.t() }
Struct containing options for Membrane.AudioMixerBin
Link to this section Functions
@spec gen_mixing_spec( [Membrane.Bin.PadData.t()], pos_integer(), Membrane.AudioMixer.t() ) :: Membrane.ParentSpec.t()
@spec membrane_pads() :: [{Membrane.Pad.name_t(), Membrane.Pad.description_t()}]
Returns pads descriptions for Membrane.AudioMixerBin
@spec options() :: keyword()
Returns description of options available for this module