forked from Keven1894/ttskit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
42 lines (28 loc) · 879 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!usr/bin/env python
# -*- coding: utf-8 -*-
# author: kuangdd
# date: 2020/2/23
"""
"""
def test_sdk_api():
from ttskit import sdk_api
wav = sdk_api.tts_sdk('文本', audio='24')
def test_cli_api():
from ttskit import cli_api
args = cli_api.parse_args()
cli_api.tts_cli(args)
def test_web_api():
from ttskit import web_api
web_api.app.run(host='0.0.0.0', port=2718, debug=False)
# 用POST或GET方法请求:http://localhost:2718/tts,传入参数text、audio、speaker。
# 例如GET方法请求:http://localhost:2718/tts?text=这是个例子&audio=2
def test_http_server():
from ttskit import http_server
http_server.start_sever()
# 打开网页:http://localhost:9000/ttskit
if __name__ == "__main__":
print(__file__)
# test_sdk_api()
# test_cli_api()
# test_web_api()
test_http_server()