PaddleSpeech
PaddleSpeech copied to clipboard
流式的websocket tts 能够支持多并发吗
目前好像不管有多少个websocket的请求都会在下面这段代码里阻塞 while True: try: tts_results = next(wav_generator) resp = {"status": 1, "audio": tts_results} await websocket.send_json(resp) except StopIteration as e: resp = {"status": 2, "audio": ''} await websocket.send_json(resp) logger.info( "Complete the synthesis of the audio streams") break except Exception as e: resp = {"status": -1, "audio": ''} await websocket.send_json(resp) break
不支持,是服务端是串行处理的。可以搭多个服务端提高并发能力。
额,我测试了下可以的,协议中不是有个session字段用来区分吗?测试方式也比较简单:先用一段较长的文本请求,然后这个长文本还没结束前再发起另外一个请求就可以验证了