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

Lake AI Service

Copy page
Download PDF
Audio processing
Audio format conversion (online)
Copy page
Download PDF
Audio format conversion (online)

Operator introduction

Description

Audio format conversion is used to uniformly convert audio or video files to a specified audio format and output them to a designated storage path.
This operator is primarily used for scenarios such as audio format standardization in data processing pipelines, extracting audio from video, and preparing training data. It supports batch concurrent processing and configurable audio encoding parameters.

Limitations

  • Access to the input source file is required (the TOS address under your account).

Key features

  1. Unified conversion of audio/video to audio
  • The input can be an audio file or a video file
  • When the input is a video file, the audio track is automatically extracted and converted to audio
  • Agnostic to upstream data types, always outputs audio files
  1. Supports custom output audio formats
  • Supports specifying the target audio format
  • Can be configured to output in wav, mp3, or flac audio formats
  • The actual supported range is subject to the underlying FFmpeg codec capabilities
  1. Supports custom output path (TOS)
  • Allows users to explicitly specify the storage path for the output audio on TOS
  • Can be used to overwrite the original file, output to a new directory, or organize files according to business rules
  • Returns the actual generated output_path to ensure result traceability
  1. Supports extension of audio encoding parameters
  • Supports passthrough of FFmpeg-level extension parameters
  • Can be used to control audio quality, compression level, or encoding strategy
  • Suitable for scenarios requiring fine-grained control over audio quality
  1. Batch concurrent processing capability
  • Supports batch input of audio or video files
  • Internal support for concurrency control and failure retry
  • Suitable for large-scale offline data processing and pipeline scenarios

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 invocation

Interface description

Invoke the las_audio_convert operator to extract audio from video and perform segmentation.

Request parameters

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

Response parameters

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

Examples

Request example

# Please set INPUT_PATH to the TOS path of the video file saved under this account
export INPUT_PATH="tos://xxxx/sample.mp4"
# Please set OUTPUT_PATH_TEMPLATE to a writable TOS path under this account
export OUTPUT_PATH_TEMPLATE="tos://xxxx/{index}/test.wav"
# Initiate function 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_convert",
    "operator_version": "v1",
    "data": {
        "input_path": "$INPUT_PATH",
        "output_path": "tos://$OUTPUT_PATH_TEMPLATE/{index}/test.wav",
        "output_format": "wav"
       }
}'

Response example

{
    "metadata": {
        "task_status": "COMPLETED",
        "business_code": "0",
        "error_msg": "",
        "request_id": "c7b29d78a99f88beda5497753ed60816"
    },
    "data": {
        "audios": [
            {
                "input_path": "tos://xxx/sample.mp3",
                "output_path": "tos://xxx/sample.mp3.wav4",
                "duration": 49.711,
                "status": "success"
            }
        ]
    }
}

Error codes

HttpCode

Error code

Error message

Description

401

Authorization.Missing

Missing Authorization.

Missing authentication

401

ApiKey.Invalid

The api key is invalid.

API key is invalid

Last updated: 2026.06.04 11:22:29