我想在c#WPF中运行唇形同步和语音并行

时间:2022-11-07 01:25:41

I am working on a virtual assistant and having difficulty in parallel running speech(audio) using the library Speech.Synthesis and the lip sync. How am I doing lipsync? I have an image wpf control and a database of images, in which there are a lot of vismey images. I change the images according to the text. If I run lip sync and audio sequentially, they work good. But when I want to do parallel using Task.Run audio works good but lip sync does not execute. I am not sure if I am using a good approach for lip sync or not. Kindly guide me if I can do something better than that or how can I run them parallel.

我正在使用虚拟助手,并且难以使用库Speech.Synthesis和唇形同步来并行运行语音(音频)。我怎么做嘴唇同步?我有一个图像wpf控件和一个图像数据库,其中有很多vismey图像。我根据文字改变图像。如果我顺序运行唇形同步和音频,它们工作正常。但是当我想使用Task.Run进行并行时,音频工作正常,但唇形同步不会执行。我不确定我是否使用了良好的唇形同步方法。如果我可以做一些比这更好的事情或者我如何能并行运行它们,请指导我。

1 个解决方案

#1


0  

Personally I would be using the RxFramework to emit “events” out of the speech routine by calling the OnNext function. I would then subscribe to these “events” in the lip sync part of your code. You can use LINQ to filter or buffer the stream coming out of the speech part of your code which is quite cool

我个人会通过调用OnNext函数使用RxFramework从语音例程中发出“事件”。然后,我会在代码的唇形同步部分订阅这些“事件”。您可以使用LINQ过滤或缓冲来自代码语音部分的流,这非常酷

#1


0  

Personally I would be using the RxFramework to emit “events” out of the speech routine by calling the OnNext function. I would then subscribe to these “events” in the lip sync part of your code. You can use LINQ to filter or buffer the stream coming out of the speech part of your code which is quite cool

我个人会通过调用OnNext函数使用RxFramework从语音例程中发出“事件”。然后,我会在代码的唇形同步部分订阅这些“事件”。您可以使用LINQ过滤或缓冲来自代码语音部分的流,这非常酷