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

Lake AI Service

Copy page
Download PDF
Audio processing
Audio segmentation
Copy page
Download PDF
Audio segmentation

Operator introduction

Description

The audio segmentation operator is used to extract audio from audio or video files and split the audio into multiple segments according to specified rules, outputting them to a user-defined storage path.
This operator is primarily used for structured processing scenarios involving long audio or video files, such as audio preprocessing, data segmentation, and training data construction. It supports batch concurrent processing and flexible output path organization.
The current version uses TOS storage addresses as both input and output formats. Support for protocols such as HTTP/HTTPS will be added in future versions.

Key features

1. Audio/video extraction and segmentation

  • The input can be an audio file or a video file.
  • When the input is a video file, the audio track is automatically extracted.
  • Supports splitting audio into multiple segments based on specified duration rules.
  • Agnostic to upstream data types and uniformly outputs multiple audio segments.

2. Supports custom segmentation rules

  • Supports configuring the segmentation duration (unit: seconds).
  • Suitable for segmenting long audio and long video files.
  • If segmentation duration is not specified, the server can process using default strategies.

3. Supports custom output audio formats

  • Supports specifying the output audio format.
  • Can be configured to common audio formats such as mp3, flac, wav, and more.
  • The range of supported formats depends on the underlying FFmpeg codec capabilities.

4. Supports output path templates

  • Supports users defining the output path for segmented audio using path templates.
  • Output path templates support placeholders (such as {index}) for generating multiple audio segment paths.
  • Suitable for organizing segmentation results by sequence, segment number, or business rules.
  • Returns a list of all generated output_paths.

5. Supports extended audio encoding parameters

  • Supports passing through FFmpeg-level extended parameters.
  • Can be used to control audio quality, encoding method, or sampling strategy.
  • Meets scenarios with refined requirements for audio processing.

Billing
  • Billing standards

    Sub-items
    Billing standards description

    Billing item

    Billing is based on usage calculated from the duration of input audio.

    Billing type

    Usage-based billing, unit: CNY/minute, billed hourly based on actual usage.

    Unit price

    0.003 CNY/minute

  • Billing details
    Billing formula: Total cost = unit price * usage

API call

Interface description

Call the las_audio_extract_and_split operator to extract audio from a video and split it.

Request parameters

Parameter name
Type
Required
Example
Description
operator_id
string
Yes
las_audio_extract_and_split
The ID of this operator is las_audio_extract_and_split.
operator_version
string
Yes
v1
Only v1 is supported currently.
data
process_param
Yes
Operator parameters

Response parameters

Parameter name
Type
Example
Description
metadata
metadata
Request metadata.
data
result
Returned data.

Example

Request example

# Set INPUT_PATH to the TOS path of the video file saved under this account
export INPUT_PATH="tos://xxxx/sample.mp4"
# Set OUTPUT_PATH_TEMPLATE to a writable TOS path under this account
export OUTPUT_PATH_TEMPLATE="tos://xxxx/{index}/test.wav"
# Initiate an operator service request
curl --location "https://operator.las.ap-southeast-1.volces.com/api/v1/process" \
--header "Content-Type: application/json" \
--header "Authorization: Bearer $LAS_API_KEY" \
--data '{
    "operator_id": "las_audio_extract_and_split",
    "operator_version": "v1",
    "data": {
        "input_path": "$INPUT_PATH",
        "output_format": "wav",
        "output_path_template": "tos://$OUTPUT_PATH_TEMPLATE/{index}/test.wav",
        "split_duration": 15
       }
}'

Response example

{
    "metadata": {
        "task_status": "COMPLETED",
        "business_code": "0",
        "error_msg": "",
        "request_id": "c7b29d78a99f88beda5497753ed60816"
    },
    "data": {
        "output_paths": [
            "tos://xxx/0/test.wav",
            "tos://xxx/1/test.wav"
        ],
        "metrics": [
            {
                "name": "duration_ms",
                "value": 26633
            }
        ]
    }
}

Error codes

HttpCode

Error code

Error message

Description

401

Authorization.Missing

Missing Authorization.

Authorization missing

401

ApiKey.Invalid

The api key is invalid.

API is invalid

Last updated: 2026.06.04 11:23:34