View Source Membrane.LiveAudioMixer (Membrane Audio Mix plugin v0.13.0)
This element performs audio mixing for live streams.
Live Audio Mixer starts to mix audio after the first input pad is added, from this point, the mixer will produce a audio until element termination.
Mixer mixes only raw audio (PCM), so some parser may be needed to precede it in pipeline.
notifications
Notifications
:schedule_eos
- mixer will sendend_of_stream
when it processes all input streams. After sending:schedule_eos
mixer will raise if it gets a new input pad.
Input pads can have offset - it tells how much timestamps differ from mixer time.
element-options
Element options
Passed via struct Membrane.LiveAudioMixer.t/0
prevent_clipping
boolean()
Default value:
true
Defines how the mixer should act in the case when an overflow happens.- If true, the wave will be scaled down, so a peak will become the maximal
value of the sample in the format. See
Membrane.AudioMixer.ClipPreventingAdder
. - If false, overflow will be clipped to the maximal value of the sample in
the format. See
Membrane.AudioMixer.Adder
.
- If true, the wave will be scaled down, so a peak will become the maximal
value of the sample in the format. See
native_mixer
boolean()
Default value:
false
The value determines if mixer should use NIFs for mixing audio. Only clip preventing version of native mixer is available. SeeMembrane.AudioMixer.NativeAdder
.latency
non_neg_integer()
Default value:
200 |> Membrane.Time.milliseconds()
The value determines after what time the clock will start interval that mixes audio in real time. Latency is crucial to quality of output audio, the smaller the value, the more packets will be lost. But the biggest the value, the latency of the stream is bigger.
pads
Pads
input
:input
Accepted formats:
%RawAudio{sample_format: sample_format}
when sample_format in [:s8, :s16le, :s16be, :s24le, :s24be, :s32le, :s32be]
Direction: | :input |
Availability: | :on_request |
Mode: | :pull |
Demand mode: | :auto |
Demand unit: | :buffers |
Pad options:
offset
Time.non_neg_t()
Default value:
0
Offset of the input audio at the pad.
output
:output
Accepted formats:
RawAudio
Direction: | :output |
Availability: | :always |
Mode: | :pull |
Demand mode: | :auto |
Link to this section Summary
Link to this section Types
@type input_pad_opts_t() :: [{:offset, Membrane.Time.non_neg_t()}]
Options for pad :input
@type t() :: %Membrane.LiveAudioMixer{ latency: non_neg_integer(), native_mixer: boolean(), prevent_clipping: boolean() }
Struct containing options for Membrane.LiveAudioMixer
Link to this section Functions
@spec options() :: keyword()
Returns description of options available for this module