Duix.Heygem icon indicating copy to clipboard operation
Duix.Heygem copied to clipboard

请问一下是只支持wav格式的视频吗,我调接口出错!

Open benzo970210 opened this issue 8 months ago • 5 comments

{"code":-1,"msg":"clean_wav failed:format failed: fail to format"}

benzo970210 avatar Apr 07 '25 10:04 benzo970210

Image 问题如图。 报错信息{"code":-1,"msg":"'Logger' object has no attribute 'warn'"},我想知道这个问题应该如何解决

benzo970210 avatar Apr 07 '25 11:04 benzo970210

代码如下

调用接口示例
<script>
    function callApi() {
        // 定义接口的 URL
        const apiUrl = 'http://xxxxxxx:18180/v1/preprocess_and_tran';
        // 定义请求参数,修改 format 字段的值
        const requestData = {
            "format": "wav",
            "reference_audio": "382714807.mp4",
            "lang": "zh"
        };

        // 发起 POST 请求
        fetch(apiUrl, {
            method: 'POST',
            headers: {
                'Content-Type': 'application/json'
            },
            body: JSON.stringify(requestData)
        })
       .then(response => response.json())
       .then(data => {
            // 将响应结果显示在页面上
            document.getElementById('result').innerHTML = JSON.stringify(data);
        })
       .catch(error => {
            // 处理请求过程中出现的错误
            document.getElementById('result').innerHTML = '请求出错: ' + error.message;
        });
    }
</script>

benzo970210 avatar Apr 07 '25 11:04 benzo970210

This is the timbre for training TTS. Only WAV files are required, and MP4 files are not needed.

whl88 avatar Apr 08 '25 06:04 whl88

/{ "format": ".wav", "reference_audio": "0414-01.wav", "lang": "zh" }

wav文件复制到容器的/code/data,POST接口返回这个,是文件格式问题么? ` [ { "type": "literal_error", "loc": [ "format" ], "msg": "Input should be 'wav', 'mp3' or 'flac'", "input": ".wav", "ctx": { "expected": "'wav', 'mp3' or 'flac'" }, "url": "https://errors.pydantic.dev/2.8/v/literal_error" } ]

`

哎,知道了,CSDN一把的教程写的是 "format": ".wav", 只要写 wav 就好。以后屏蔽CSDN得了。

makrie avatar Apr 14 '25 07:04 makrie

Image 问题如图。 报错信息{"code":-1,"msg":"'Logger' object has no attribute 'warn'"},我想知道这个问题应该如何解决

这个怎么解决的,我用api调用模特训练出这个问题

18027271644 avatar Apr 29 '25 06:04 18027271644