Skip to content

Commit

Permalink
Merge pull request #3 from wanan99/patch-3
Browse files Browse the repository at this point in the history
Update rules-tts.md
  • Loading branch information
freenovel123 authored Nov 25, 2024
2 parents 218f198 + 5fa7955 commit d85a122
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion docs/制作源/rules-tts.md
Original file line number Diff line number Diff line change
@@ -1 +1,37 @@
# 自定义TTS
# 自定义TTS
## 请求示例
```javascript
// 请求地址
let url = 'https://www.baidu.com';

// 请求参数
let params = {
type: 'zh-linzhilin',
text: '你好,世界!'
};

// 请求header
let header = {
token: 'xxx'
};

// POST请求,具体参考文档 native-to-js
let response = await app.post({
url,
params,
header
});

// 如果responseBody是一个json字符串
let json = app.stringToJson(response.responseBody);

// 获取到语音文件的地址
let voiceUrl = json.url;

return {
url: voiceUrl, // 语音请求地址
method: 'GET', // 请求方式
params: {}, // 携带的参数
header: {}, // 携带的header
cookie: {} // 携带的cookie
};

0 comments on commit d85a122

Please sign in to comment.