You need to enable JavaScript to run this app.
Lake AI Service

Lake AI Service

Copy page
Download PDF
Audio recognition
Speech endpoint detection (Silero model)
Copy page
Download PDF
Speech endpoint detection (Silero model)

Operator introduction

Description

Speech endpoint detection module – an efficient audio segmentation solution based on Silero VAD

Key features

  • Speech endpoint detection: Automatically identifies the start and end times of speech segments in audio, enabling precise segmentation of speech and silence.
  • Batch processing: Supports efficient endpoint detection for large volumes of audio data.
  • Multi-format input: Compatible with various audio input methods, including raw binary, Base64 encoding, and TOS/HTTP links.
  • GPU acceleration: Supports high-performance inference in GPU environments.
  • High versatility: Delivers excellent performance when processing audio from different domains, with various background noise and quality levels.

  • It is recommended to use WAV format audio with an 8k or 16k sampling rate and mono channel to improve detection accuracy.
  • GPU acceleration does not provide a significant speedup; in scenarios where extreme performance is not required, you can use CPU inference with the onnx model.
  • Applicable to scenarios such as voice activity detection and speech segmentation.

Supported models

  • silero_vad.onnx (corresponding to onnx_model_revision=16)
  • silero_vad_16k_op15.onnx (corresponding to onnx_model_revision=15)
  • silero_vad.jit

Output description

  • For each audio, a two-dimensional list of floating-point numbers is output, representing the start and end timestamps (in seconds) of all speech segments, for example: [[0.0, 4.34], [5.50, 7.12]].
  • Returns None if processing fails.

Daft invocation

Operator parameters

Input

Input column name

Description

videos

A column containing audio data, supporting the following formats: - audio_base64: Base64-encoded audio string - audio_url: URL path of the audio file - audio_binary: Raw audio byte data

Output

A column containing speech endpoint timestamps, where each element is a list of two floating-point numbers representing the start and end timestamps (in seconds) of each speech segment in the audio,
for example: [[0.0, 4.34], [5.50, 7.12]]. Returns None if processing fails.

Parameters

If a parameter does not have a default value, it is required.

Parameter name

Type

Default value

Description

audio_src_type

str

Audio format type Supported audio format types include: - tos/http address (audio_url) - Base64 encoding (audio_base64) - Binary stream (audio_binary) Optional values: ["audio_binary", "audio_url", "audio_base64"]

model_path

str

/opt/las/models

Model path: Local model storage path. Default value: "/opt/las/models"

model_name

str

silero-vad

Model name. The model name used includes silero-vad. Optional values: ["silero-vad"]. Default value: "silero-vad".

use_onnx_model

bool

True

Whether to use the onnx model. Default value: True.

onnx_model_revision

int

16

ONNX model version. Optional values: [16, 15]. Default value: 16.

Examples

The following code demonstrates how to use daft to run the operator to identify voice endpoints in audio.

from __future__ import annotations

import logging
import os

import ray

import daft
from daft import col
from daft.las.functions.audio.audio_vad_silero import AudioVadSilero
from daft.las.functions.udf import las_udf

if __name__ == "__main__":
    if os.getenv("DAFT_RUNNER", "ray") == "ray":

        def configure_logging():
            logging.basicConfig(
                level=logging.INFO,
                format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
                datefmt="%Y-%m-%d %H:%M:%S.%s".format(),
            )
            logging.getLogger("tracing.span").setLevel(logging.WARNING)
            logging.getLogger("daft_io.stats").setLevel(logging.WARNING)
            logging.getLogger("DaftStatisticsManager").setLevel(logging.WARNING)
            logging.getLogger("DaftFlotillaScheduler").setLevel(logging.WARNING)
            logging.getLogger("DaftFlotillaDispatcher").setLevel(logging.WARNING)

        import ray

        ray.init(dashboard_host="0.0.0.0", runtime_env={"worker_process_setup_hook": configure_logging})
        daft.set_runner_ray()

    daft.set_execution_config(actor_udf_ready_timeout=600)
    daft.set_execution_config(min_cpu_per_task=0)

    tos_dir_url = os.getenv("TOS_DIR_URL", "las-cn-beijing-public-online.tos-cn-beijing.volces.com")
    samples = {
        "audio_path": [
            f"https://{tos_dir_url}/public/shared_audio_dataset/.wav"
        ]
    }

    model_path = os.getenv("MODEL_PATH", "/opt/las/models")
    model_name = "silero-vad"
    audio_src_type = "audio_url"
    use_onnx_model = True
    onnx_model_revision = 16

    df = daft.from_pydict(samples)
    df = df.with_column(
        "audio_vad_result",
        las_udf(
            AudioVadSilero,
            construct_args={
                "audio_src_type": audio_src_type,
                "model_path": model_path,
                "model_name": model_name,
                "use_onnx_model": use_onnx_model,
                "onnx_model_revision": onnx_model_revision,
            },
            num_gpus=1,
            batch_size=1,
            concurrency=1,
        )(col("audio_path")),
    )
    df.show()

    # ╭────────────────────────────────┬─────────────────────╮
    # │ audio_path                     ┆ audio_vad_result    │
    # │ ---                            ┆ ---                 │
    # │ Utf8                           ┆ List[List[Float32]] │
    # ╞════════════════════════════════╪═════════════════════╡
    # │tos://las-cn-beijing-public-on… ┆ [[0.8, 2.4]]        │
    # ╰────────────────────────────────┴─────────────────────╯
Last updated: 2026.05.12 19:06:34