diff --git a/client.py b/client.py index 173dbdd..d7be0f8 100644 --- a/client.py +++ b/client.py @@ -22,21 +22,19 @@ @author: nl8590687 ASRT语音识别asrserver测试专用客户端 ''' - +import time import requests from utils.ops import read_wav_data -url = 'http://127.0.0.1:20000/' -token = 'qwertasd' - +URL = 'http://127.0.0.1:20000/' +TOKEN = 'qwertasd' wavsignal, fs, _, _ = read_wav_data('X:\\语音数据集\\data_thchs30\\train\\A11_0.wav') +datas={'token':TOKEN, 'fs':fs, 'wavs':wavsignal} -datas={'token':token, 'fs':fs, 'wavs':wavsignal} -import time t0=time.time() -r = requests.post(url, datas) +r = requests.post(URL, datas) t1=time.time() r.encoding='utf-8' print(r.text) -print('time:', t1-t0, 's') \ No newline at end of file +print('time:', t1-t0, 's')