This topic describes how to use the CreateMediaConvertTask operation of Intelligent Media Management (IMM) to merge audio files.
Feature introduction
Audio merging is a technique that combines multiple audio segments into a continuous audio file. Through audio merging, users can select different audio materials for editing and integration to create expressive and naturally coherent audio works.

Scenarios
Music production: In the music creation process, audio merging technologies are used to integrate different instrument tracks, vocal parts, or segments into a complete musical work, enhancing the flexibility and creativity of the production process.
Audio editing: In the editing process of news reports, documentaries, and other audio programs, audio merging technologies help editors optimize audio content to improve its coherence and listenability.
Education and training: Courses or lectures can be merged to integrate different content segments to produce audio materials that are convenient for students to learn and review.
Supported audio and video formats
Category | Format |
Audio | Mainstream audio formats, such as AAC, MP3, WAV, FLAC, WMA, AC3, and Opus. |
Video | Mainstream video formats, such as MP4, MPEG-TS, MKV, MOV, AVI, FLV, M3U8, WebM, WMV, RM, and VOB. |
Use audio merging
Prerequisites
An AccessKey pair is created and obtained. For more information, see Create an AccessKey pair.
Object Storage Service (OSS) is activated and a bucket is created. For more information, see Create a bucket.
IMM is activated. For more information, see Activate IMM.
A project is created in the IMM console. For more information, see Create a project.
NoteYou can call the CreateProject operation to create a project. For more information, see CreateProject.
You can call the ListProjects operation to list information of all projects in a region.
Step 1: Upload files
You can use the OSS console to upload media files to a bucket in the region where your IMM project is located.

Step 2: Use IMM audio merging
Call the CreateMediaConvertTask operation to create an audio merging task.
Parameter examples
The following examples use the IMM project test-project for audio merging processing. For more information about media processing features, see Media transcoding.
You can use the CreateMediaConvertTask operation to process video files in OpenAPI Explorer. For more information, see the SDK sample code.
Merge an opening segment and an ending segment into an audio file
Paths to input audio files:
oss://test-bucket/video-demo/head.mp3,oss://test-bucket/video-demo/test.mp3,oss://test-bucket/video-demo/tail.mp3Main media file index: 1
Audio configurations: AAC format, 96 Kbit/s bitrate, dual sound channel, 44.1 kHz sample rate
Output audio format: AAC
Output file path:
oss://test-bucket/video-demo/concat.aacMerging completion notification: Send a Simple Message Queue (SMQ) message to the SMQ topic "test-mns-topic".
For the SDK sample code, visit OpenAPI Explorer. The parameters in the sample code are automatically configured for reference. Modify the parameters based on your business requirements before you perform debugging.
Request parameters
{
"ProjectName": "test-project",
"AlignmentIndex": 1,
"Notification": {
"MNS": {
"TopicName": "test-mns-topic"
}
},
"Sources": [
{
"URI": "oss://test-bucket/video-demo/head.mp3"
},
{
"URI": "oss://test-bucket/video-demo/test.mp3"
},
{
"URI": "oss://test-bucket/video-demo/tail.mp3"
}
],
"Targets": [
{
"Audio": {
"TranscodeAudio": {
"Bitrate": 96000,
"Channel": 2,
"Codec": "aac",
"SampleRate": 44100
}
},
"Container": "aac",
"URI": "oss://test-bucket/video-demo/concat.{autoext}"
}
]
}Merge two audio segments into one MP3 audio file
Paths to input audio files:
oss://test-bucket/video-demo/test.mp3,oss://test-bucket/video-demo/test1.mp3Main media file index: 0
Audio configurations: MP3 format, 128 Kbit/s bitrate, dual sound channel, 44.1 kHz sample rate
Output audio format: MP3
Output file path:
oss://test-bucket/video-demo/concat.mp3Merging completion notification: Send an SMQ message to the SMQ topic "test-mns-topic".
For the SDK sample code, visit OpenAPI Explorer. The parameters in the sample code are automatically configured for reference. Modify the parameters based on your business requirements before you perform debugging.
Request parameters
{
"ProjectName": "test-project",
"AlignmentIndex": 0,
"Notification": {
"MNS": {
"TopicName": "test-mns-topic"
}
},
"Sources": [
{
"URI": "oss://test-bucket/video-demo/test.mp3"
},
{
"URI": "oss://test-bucket/video-demo/test1.mp3"
}
],
"Targets": [
{
"Audio": {
"TranscodeAudio": {
"Bitrate": 128000,
"Channel": 2,
"Codec": "mp3",
"SampleRate": 44100
}
},
"Container": "mp3",
"URI": "oss://test-bucket/video-demo/concat.{autoext}"
}
]
}