From 1a94ede098413909b6c46e170b4f9d98c3cfd540 Mon Sep 17 00:00:00 2001 From: nl <3210346136@qq.com> Date: Sat, 20 Nov 2021 21:43:34 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E9=A3=8E=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) 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')