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

Can it support asynchronous synthesis? #462

Open
High-calcium-tiger opened this issue Apr 9, 2024 · 2 comments
Open

Can it support asynchronous synthesis? #462

High-calcium-tiger opened this issue Apr 9, 2024 · 2 comments

Comments

@High-calcium-tiger
Copy link

I find function synthesis use session.onnx.Run() to synthesis audio data in piper.cpp line386.
this is synchronous. I want asynchronous to synthesis audio data.

I find function RunAsync() in onnxruntime_cxx_api.h in onnxruntime-main project source code.
Can I understand that switching to this function will enable asynchronous support?
Can give me a pitch fo asynchronous to synthesis audio data?
thank you.

@MikePooh
Copy link

MikePooh commented May 16, 2024

Let me join the question.
I am using piper as library in my Qt/C++ programm. Using Qt's Qt::Concurrent::run API I can easilly start piper's textToAudio function in separate thread and get result once function finished. However this doesn't support cancellation. So in case of interruption computation of textToAudio function still going till the end.

Maybe there is an option to run this function in a manner of cycle? And on each iteration to check interruption flag and, optionally, signal progress.

@geneing
Copy link

geneing commented May 27, 2024

I think what you are looking for is demonstrated in this example:
https://github.com/rhasspy/piper/blob/master/src/python/piper_train/infer_onnx_streaming.py

You'll need to export the model in two parts: encoder and decoder
https://github.com/rhasspy/piper/blob/master/src/python/piper_train/export_onnx_streaming.py

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

No branches or pull requests

3 participants