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

Simple vad based on audio level sent in RTP header.

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

If avg of audio level in packets in time_window exceeds vad_threshold it emits notification speech_notification_t/0.

When avg falls below vad_threshold and doesn't exceed it in the next vad_silence_timer it emits notification silence_notification_t/0.

Element options

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

  • time_window

    pos_integer()

    Default value: 2000000000
    Time window (in ns) in which avg audio level is measured.

  • min_packet_num

    pos_integer()

    Default value: 50
    Minimal number of packets to count avg audio level from. Speech won't be detected until there are enough packets.

  • vad_threshold

    -127..0

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

  • vad_silence_time

    pos_integer()

    Default value: 300
    Time to wait before emitting notification silence_notification_t/0 after audio track is no longer considered to represent speech. If at this time audio track is considered to represent speech again the notification will not be sent.

Pads

:input

Availability:always
Caps:any
Demand unit:buffers
Direction:input
Mode:pull
Name:input

:output

Availability:always
Caps:any
Direction:output
Mode:pull
Name:output

Link to this section Summary

Types

Notification sent after detecting silence activity.

Notification sent after detecting speech activity.

t()

Struct containing options for Membrane.RTP.VAD

Functions

Returns pads descriptions for Membrane.RTP.VAD

Returns description of options available for this module

Link to this section Types

Link to this type

silence_notification_t()

View Source

Specs

silence_notification_t() :: {:vad, :silence}

Notification sent after detecting silence activity.

Link to this type

speech_notification_t()

View Source

Specs

speech_notification_t() :: {:vad, :speech}

Notification sent after detecting speech activity.

Specs

t() :: %Membrane.RTP.VAD{
  min_packet_num: pos_integer(),
  time_window: pos_integer(),
  vad_silence_time: pos_integer(),
  vad_threshold: -127..0
}

Struct containing options for Membrane.RTP.VAD

Link to this section Functions

Specs

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

Returns pads descriptions for Membrane.RTP.VAD

Specs

options() :: keyword()

Returns description of options available for this module