合成语音API参数不正确
炼石科技 发布于2020-12 浏览:467 回复:1
0
收藏

static Future textToAudio(String text) async {
String ulr = Uri.encodeComponent(text); // To encode url
ulr = Uri.encodeComponent(ulr);
Dio dio = new Dio();

FormData formData = FormData.fromMap({
"tex": ulr,
"tok": InitNet.accessToken,
"cuid": "355697073811204",
"ctp": 1,
"lan": "zh",
"spd": 5,
"pit": 5,
"vol": 5,
"per": 0,
"aue": 6
});
String url = "https://tsn.baidu.com/text2audio?";
Response response = await dio.post(url, data: formData);
String result = response.data.toString();
}

收藏
点赞
0
个赞
共1条回复 最后由用户已被禁言回复于2022-04
#2用户已被禁言回复于2020-12

你好,请问现在是有什么问题吗?如有参数不明确,可以查看文档并测试官方 demo https://github.com/Baidu-AIP/speech-demo/tree/master/rest-api-tts

0
TOP
切换版块