我不会在招摇中播放wav文件(音频)
我有一个flask服务器,并编写了关于该服务器的swagger.yaml文件
flask服务器返回如下wav文件
@app.route("/tts", methods=["POST"])
def generateTTS():
if request.method == "POST":
input_text = request.form["input_text"]
batched = request.form["batched"]
input_text = preprocessing(input_text)
wav_file = getTTS(input_text, batched)
save_path = wav_file[1]
wav_file = wav_file[0]
return send_file(save_path, mimetype="audio/wav")
和我的炫耀文件(3.0.0版)
paths:
/tts:
post:
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
properties:
input_text:
type: string
batched:
type: boolean
responses:
'200':
description: Success
content:
audio/wav:
schema:
type: string
format: base64
我试图更改响应“200”架构类型format: binary
{
若我使用curl,那个么我可以接收wav文件,但若我在swagger中尝试,我不会播放wav文件并下载wav文件
如何在swagger中接收和播放wav文件
谢谢你阅读我的问题
目前没有回答
相关问题 更多 >
编程相关推荐