View Source Membrane.RTP.VAD (Membrane RTP plugin v0.27.1)

Vad based on audio level sent in RTP header.

To make this module work appropriate RTP header extension has to be set in the SDP offer/answer.

Sends Membrane.RTP.VadEvent when a score from Membrane.RTP.Vad.IsSpeakingEstimator changes.

A more detailed explanation of how the VAD algorithm can be found in the Membrane.RTP.Vad.IsSpeakingEstimator module.

Buffers that are processed by this element may or may not have been processed by a depayloader and passed through a jitter buffer. If they have not, then the only timestamp available for time comparison is the RTP timestamp.

When calculating the epoch of the timestamp, we need to account for 32bit integer wrapping.

  • :current - the difference between timestamps is low: the timestamp has not wrapped around.
  • :next - the timestamp has wrapped around to 0. To simplify queue processing we reset the state.
  • :prev - the timestamp has recently wrapped around. We might receive an out-of-order packet from before the rollover, which we ignore.

Element options

Passed via struct Membrane.RTP.VAD.t/0

  • vad_id

    1..14

    Required
    ID of VAD header extension.

  • vad_threshold

    -127..0

    Default value: -32
    Audio level in dBov representing vad threshold. Values above are considered to represent voice activity. Value -127 represents digital silence.

Pads

:input

Accepted formats:

_any
Direction::input
Availability::always
Flow control::auto

:output

Accepted formats:

_any
Direction::output
Availability::always
Flow control::auto

Summary

Types

t()

Struct containing options for Membrane.RTP.VAD

Functions

Returns description of options available for this module

Types

@type t() :: %Membrane.RTP.VAD{vad_id: 1..14, vad_threshold: -127..0}

Struct containing options for Membrane.RTP.VAD

Functions

@spec options() :: keyword()

Returns description of options available for this module