翻唱前处理 (Music Cover Preprocess)
curl --request POST \
--url https://api.minimaxi.com/v1/music_cover_preprocess \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data '
{
"model": "music-cover",
"audio_url": "https://example.com/song.mp3"
}
'import requests
url = "https://api.minimaxi.com/v1/music_cover_preprocess"
payload = {
"model": "music-cover",
"audio_url": "https://example.com/song.mp3"
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: 'Bearer <token>'},
body: JSON.stringify({model: 'music-cover', audio_url: 'https://example.com/song.mp3'})
};
fetch('https://api.minimaxi.com/v1/music_cover_preprocess', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.minimaxi.com/v1/music_cover_preprocess",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'music-cover',
'audio_url' => 'https://example.com/song.mp3'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.minimaxi.com/v1/music_cover_preprocess"
payload := strings.NewReader("{\n \"model\": \"music-cover\",\n \"audio_url\": \"https://example.com/song.mp3\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.minimaxi.com/v1/music_cover_preprocess")
.header("Content-Type", "<content-type>")
.header("Authorization", "Bearer <token>")
.body("{\n \"model\": \"music-cover\",\n \"audio_url\": \"https://example.com/song.mp3\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.minimaxi.com/v1/music_cover_preprocess")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"model\": \"music-cover\",\n \"audio_url\": \"https://example.com/song.mp3\"\n}"
response = http.request(request)
puts response.read_body{
"cover_feature_id": "a1b2c3d4e5f67890abcdef1234567890",
"formatted_lyrics": "[Verse 1]\n歌曲第一行\n歌曲第二行\n\n[Chorus]\n这是副歌部分\n高声歌唱",
"structure_result": "{\"num_segments\":4,\"segments\":[{\"start\":0,\"end\":15.5,\"label\":\"intro\"},{\"start\":15.5,\"end\":45.2,\"label\":\"verse\"},{\"start\":45.2,\"end\":75.0,\"label\":\"chorus\"},{\"start\":75.0,\"end\":90.0,\"label\":\"outro\"}]}",
"audio_duration": 90,
"trace_id": "061e5f144eb7f10b1fdde81126e24f91",
"base_resp": {
"status_code": 0,
"status_msg": "success"
}
}音乐生成
翻唱前处理 (Music Cover Preprocess)
对参考音频进行预处理,提取音频特征和歌词,用于两步翻唱流程。
POST
/
v1
/
music_cover_preprocess
翻唱前处理 (Music Cover Preprocess)
curl --request POST \
--url https://api.minimaxi.com/v1/music_cover_preprocess \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data '
{
"model": "music-cover",
"audio_url": "https://example.com/song.mp3"
}
'import requests
url = "https://api.minimaxi.com/v1/music_cover_preprocess"
payload = {
"model": "music-cover",
"audio_url": "https://example.com/song.mp3"
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: 'Bearer <token>'},
body: JSON.stringify({model: 'music-cover', audio_url: 'https://example.com/song.mp3'})
};
fetch('https://api.minimaxi.com/v1/music_cover_preprocess', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.minimaxi.com/v1/music_cover_preprocess",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'music-cover',
'audio_url' => 'https://example.com/song.mp3'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.minimaxi.com/v1/music_cover_preprocess"
payload := strings.NewReader("{\n \"model\": \"music-cover\",\n \"audio_url\": \"https://example.com/song.mp3\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.minimaxi.com/v1/music_cover_preprocess")
.header("Content-Type", "<content-type>")
.header("Authorization", "Bearer <token>")
.body("{\n \"model\": \"music-cover\",\n \"audio_url\": \"https://example.com/song.mp3\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.minimaxi.com/v1/music_cover_preprocess")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"model\": \"music-cover\",\n \"audio_url\": \"https://example.com/song.mp3\"\n}"
response = http.request(request)
puts response.read_body{
"cover_feature_id": "a1b2c3d4e5f67890abcdef1234567890",
"formatted_lyrics": "[Verse 1]\n歌曲第一行\n歌曲第二行\n\n[Chorus]\n这是副歌部分\n高声歌唱",
"structure_result": "{\"num_segments\":4,\"segments\":[{\"start\":0,\"end\":15.5,\"label\":\"intro\"},{\"start\":15.5,\"end\":45.2,\"label\":\"verse\"},{\"start\":45.2,\"end\":75.0,\"label\":\"chorus\"},{\"start\":75.0,\"end\":90.0,\"label\":\"outro\"}]}",
"audio_duration": 90,
"trace_id": "061e5f144eb7f10b1fdde81126e24f91",
"base_resp": {
"status_code": 0,
"status_msg": "success"
}
}授权
请求头
请求体的媒介类型,请设置为 application/json,确保请求数据的格式为 JSON
可用选项:
application/json 请求体
application/json
模型名称。必须为 music-cover。
可用选项:
music-cover 参考音频的 URL 地址。audio_url 和 audio_base64 必须且只能提供其中一个。
参考音频要求:
- 时长:6 秒至 6 分钟
- 大小:最大 50 MB
- 格式:支持常见音频格式(mp3、wav、flac 等)
Base64 编码的参考音频。audio_url 和 audio_base64 必须且只能提供其中一个。
参考音频要求:
- 时长:6 秒至 6 分钟
- 大小:最大 50 MB
- 格式:支持常见音频格式(mp3、wav、flac 等)
响应
200 - application/json
通过 ASR 从参考音频中提取并格式化的歌词,包含 [Verse]、[Chorus]、[Bridge] 等段落标签。你可以修改这些歌词后传入音乐生成接口。
JSON 字符串,包含歌曲结构分析结果,含段落类型(intro、verse、chorus、bridge、outro、inst、silence)及其起止时间戳(秒)。
参考音频的时长(秒)。
请求追踪 ID。
状态码及详情
Show child attributes
Show child attributes
此页面对您有帮助吗?
⌘I