ASRT_SpeechRecognition/testClient.py

27 lines
453 B
Python
Raw Normal View History

2018-07-28 17:15:29 +08:00
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
@author: nl8590687
asrserver测试专用客户端
'''
import requests
from general_function.file_wav import *
url = 'http://127.0.0.1:20000/'
token = 'qwertasd'
2018-07-28 17:17:38 +08:00
wavsignal,fs=read_wav_data('E:\\语音数据集\\ST-CMDS-20170001_1-OS\\20170001P00241I0052.wav')
2018-07-28 17:15:29 +08:00
#print(wavsignal,fs)
datas={'token':token, 'fs':fs, 'wavs':wavsignal}
r = requests.post(url, datas)
r.encoding='utf-8'
print(r.text)