You need to enable JavaScript to run this app.
Torch Object Storage

Torch Object Storage

Copy page
Download PDF
Media processing
AudioConcat
Copy page
Download PDF
AudioConcat
Description​
This interface is used for concatenating audio segments. You can use the audio segment synthesis feature to combine multiple audio clips into one and convert it to the required format.​
Notes​
  • Audio segment concatenation only supports asynchronous processing (x-oss-async-process mode).​
  • You must have the necessary permissions for PostDataProcess data processing.​
  • Supports concatenation of up to 11 audio segments. After all segments are concatenated, the total duration must not exceed 1 hour.​
Request syntax​
​
// Perform audio splicing on the file example.wav.​
POST /example.wav?x-tos-async-process HTTP/1.1​
Host: test-bucket.tos-cn-beijing.volces.com​
Date: Fri, 28 Oct 2024 06:40:10 GMT​
Authorization: <authorization string>​
​
x-tos-async-process=audio/concat,f_aac,ac_2,ar_44100,ab_96000/pre,o_cHJlLm1wMw==/sur,o_c3VyXzEuYWFj,ss_4000,t_10000/sur,o_c3VyXzIuYWFj,ss_10000&x-tos-save-object=b3V0cHV0LmFhYw​
​
Request parameters and headers ​
For common request headers, see Common Parameters.​
​
Name​
Location​
Type​
Required​
Example value​
Description​
x-tos-async-process​
Query​
String​
Yes​
-​
Special identifier representing audio segment concatenation requests​
​
Request body elements​
Concatenation parameters​
Concatenate according to the order of pre and sur in the request string, as follows:​
  • /pre: The audio file to prepend.​
  • /sur: The audio file to append.​
​
Name​
Type​
Required​
Example value​
Description​
ss​
int​
No​
0​
Start time for stitching prefix or suffix audio.​
Unit is milliseconds; values:​
  • 0 (default): Start from the beginning.​
  • Greater than 0: Start from ss milliseconds.​
t​
int​
No​
0​
Duration of prefix or suffix audio splicing.​
Unit is milliseconds; values:​
  • 0 (default): Continues until the end position.​
  • Greater than 0: Continues for t milliseconds.​
o​
String​
Yes​
-​
Object under the current Bucket.​
Must be encoded using Base64 URL-safe method.​
​
Transcoding parameters​
​
Name​
Type​
Required​
Example value​
Description​
ss​
int​
No​
0​
Transcoding start time of the spliced audio.​
Unit is milliseconds; values:​
  • 0 (default): Start from the beginning.​
  • Greater than 0: Start from ss milliseconds.​
t​
int​
No​
0​
Duration of transcoding for the spliced audio.​
Unit is milliseconds; values:​
  • 0 (default): Continues until the end position.​
  • Greater than 0: Lasts for t milliseconds.​
f​
String​
Yes​
wav​
Audio container.​
Options:​
  • wav​
  • mp3​
  • aac​
  • flac​
  • oga​
  • ac3​
  • opus​
ar​
int​
No​
8000​
Audio sample rate.​
Defaults to match the specified source audio; values:​
  • 8000​
  • 11025​
  • 12000​
  • 16000​
  • 22050​
  • 24000​
  • 32000​
  • 44100​
  • 48000​
  • 64000​
  • 88200​
  • 96000​
tip​
Sampling rates supported vary by format. For details, see Support for different audio container sample rates.​
ac​
int​
No​
1​
Number of audio channels.​
Defaults to the source audio setting. Valid range: 1 to 8.​
tip​
The number of channels supported varies by format. See Support for different audio container parameters for details.​
ab​
int​
No​
1000​
Audio bit rate (bitrate).​
Unit is bits per second (bps), range: 1000~10000000.​
abopt​
String​
No​
0​
Audio bitrate options.​
The values are:​
  • 0 (default): Always use the target audio bitrate.​
  • 1: If any source audio bitrate in the splice list is less than the ab parameter, use the smallest source audio bitrate in the splice list.​
  • 2: If any source audio bitrate in the splice list is less than the ab parameter, return failure.​
tip​
This parameter must be set together with the ab parameter.​
sf​
String​
No​
fltp​
Sampling format.​
Options:​
  • fltp​
  • s16​
  • s16p​
  • s32​
  • s32p​
tip​
The supported sampling formats vary by format. For details, see Support for different audio container parameters.​
​
Support for different audio container parameters​
​
Container format​
Encoding format​
Sampling rate​
Sampling format​
Number of channels​
Bit rate​
mp3​
mp3​
Partially supported​
fltp/s16p/s32p​
1 or 2​
Supported​
aac​
aac​
Supported​
fltp​
1, 2, 4, 5, 6, or 8​
Supported​
flac​
flac​
Supported​
s16/s32/s16p/s32p​
1, 2, 4, 5, 6, or 8​
Not supported​
oga​
vorbis​
Supported​
fltp​
2​
Not supported​
ac3​
ac3​
Partially supported​
fltp​
1, 2, 3, 4, 5, or 6​
Supported​
opus​
opus​
Partially supported​
s16​
1 or 2​
Supported​
wav​
pcm_s16le​
Supported​
s16​
1 or 2​
Not supported​
​
Support for different audio container sample rates​
​
Container format​
mp3​
aac​
flac​
oga​
ac3​
opus​
wav​
8000​
Y​
Y​
Y​
Y​
N​
Y​
Y​
11025​
Y​
Y​
Y​
Y​
N​
N​
Y​
12000​
Y​
Y​
Y​
Y​
N​
N​
Y​
16000​
Y​
Y​
Y​
Y​
N​
Y​
Y​
22050​
Y​
Y​
Y​
Y​
N​
N​
Y​
24000​
Y​
Y​
Y​
Y​
N​
Y​
Y​
32000​
Y​
Y​
Y​
Y​
Y​
N​
Y​
44100​
Y​
Y​
Y​
Y​
Y​
N​
Y​
48000​
Y​
Y​
Y​
Y​
Y​
Y​
Y​
88200​
N​
Y​
Y​
Y​
N​
N​
Y​
96000​
N​
Y​
Y​
Y​
N​
N​
Y​
​
Response headers​
The response contains common headers. For more information, see Common Parameters.​
Response body elements​
​
Name​
Type​
Example value​
Description​
status​
String​
OK​
Status code.​
​
Sample request​
​
POST /example.wav?x-tos-async-process HTTP/1.1​
Host: test-bucket.tos-cn-beijing.volces.com​
Date: Fri, 28 Oct 2024 06:40:10 GMT​
Authorization: <authorization string>​
​
x-tos-async-process=audio/concat,f_aac,ac_2,ar_44100,ab_96000/pre,o_cHJlLm1wMw==/sur,o_c3VyXzEuYWFj,ss_4000,t_10000/sur,o_c3VyXzIuYWFj,ss_10000&x-tos-save-object=b3V0cHV0LmFhYw​
​
Sample response​
​
HTTP/1.1 200 OK​
x-tos-id-2: f91b0c03a01300c1-a444ed0 ​
x-tos-request-id: f91b0c03a01300c1-a444ed0 ​
Date: Fri, 30 Jul 2021 06:45:39 GMT​
server: TosServer​
Content-Length: 0​
{​
"status": "OK"​
} ​
​
​
Last updated: 2026.07.31 18:42:45