Skip to content

语音降噪 API

请求地址

POST 方法:/api/audio/dtln

请求参数

参数名类型必填说明
contentstring输入路径,可以是音频、视频或文件夹路径
outstring输出格式[二选一],audio 音频、video 视频
modestring处理模式[二选一],file 单文件模式、folder 文件夹批处理

示例代码

python
import requests

url = 'http://127.0.0.1:5699/api/audio/dtln'
data = {
    'content': '/path/to/audio.mp3',
    'out': 'audio',
    'mode': 'file'
}
r = requests.post(url, data=data)
print(r.json())
import requests

url = 'http://127.0.0.1:5699/api/audio/dtln'
data = {
    'content': '/path/to/audio.mp3',
    'out': 'audio',
    'mode': 'file'
}
r = requests.post(url, data=data)
print(r.json())
js
let formData = new FormData();
formData.append("content", "/path/to/audio.mp3");
formData.append("out", "audio");
formData.append("mode", "file");

fetch("http://127.0.0.1:5699/api/audio/dtln", {
  method: "POST",
  body: formData,
})
  .then((response) => response.json())
  .then((data) => {
    console.log(data);
  });
let formData = new FormData();
formData.append("content", "/path/to/audio.mp3");
formData.append("out", "audio");
formData.append("mode", "file");

fetch("http://127.0.0.1:5699/api/audio/dtln", {
  method: "POST",
  body: formData,
})
  .then((response) => response.json())
  .then((data) => {
    console.log(data);
  });
bash
curl -X POST -F 'content=@/path/to/audio.mp3' -F 'out=audio' -F 'mode=file' http://127.0.0.1:5699/api/audio/dtln
curl -X POST -F 'content=@/path/to/audio.mp3' -F 'out=audio' -F 'mode=file' http://127.0.0.1:5699/api/audio/dtln

响应结果

json
{ "status": "success", "msg": "ok" }
{ "status": "success", "msg": "ok" }

Powered by 小白兔AI