Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

流式的websocket tts 能够支持多并发吗 #3738

Open
QAQyy opened this issue Apr 11, 2024 · 2 comments
Open

流式的websocket tts 能够支持多并发吗 #3738

QAQyy opened this issue Apr 11, 2024 · 2 comments
Labels

Comments

@QAQyy
Copy link

QAQyy commented Apr 11, 2024

目前好像不管有多少个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

@QAQyy QAQyy added the Question label Apr 11, 2024
@Ankh-L
Copy link

Ankh-L commented Apr 19, 2024

不支持,是服务端是串行处理的。可以搭多个服务端提高并发能力。

@ximply
Copy link

ximply commented Apr 28, 2024

额,我测试了下可以的,协议中不是有个session字段用来区分吗?测试方式也比较简单:先用一段较长的文本请求,然后这个长文本还没结束前再发起另外一个请求就可以验证了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants