Software Archive
Read-only legacy content
17061 Discussions

Speech Synthesis freezes execution in Unity

Joel_C_
Beginner
406 Views

I recently starting toying with the RealSense's Speech Recognition and Speech Synthesis. 

I've got the Speech Synthesis to work, but when I output the audio, the game freezes execution while the audio is dictated, and then continues running when the audio is complete. I'm using Unity, and I'm calling the VoiceSynthesis.Speak function given with the Unity framework of the SDK. 

Is this a known issue? Has anyone come across this and found a way to get around it?

0 Kudos
6 Replies
Joel_C_
Beginner
406 Views

Fixed it.

I just put all of the speech synthesis in its own separate thread. Works great now!

0 Kudos
Vidyasagar_MSC
Innovator
406 Views

That's cool. Thanks for sharing this Joel.

0 Kudos
Akshay_A_
Beginner
406 Views

 

@Joel C. 
 hi

I m also working on speech synthesis module of realsense on unity..
I m extracting my code for unity from the sdk mannuals . I am also in trouble as where "to send audio to the audio device".. I am not able to implement my module..Can you assist me in providing any solution to this situation.. and Also DId you extracted the code for unity from the Csharp framework provided in the samples directory of the SDK.???

thanks,.

0 Kudos
Joel_C_
Beginner
406 Views

Akshay A. wrote:

I am also in trouble as where "to send audio to the audio device".. I am not able to implement my module..Can you assist me in providing any solution to this situation.. and Also DId you extracted the code for unity from the Csharp framework provided in the samples directory of the SDK.???

They provide two scripts in the Unity C# framework that will output the audio. I believe the scripts are called VoiceOut.cs and VoiceSynthesis.cs. Once they're in your project, you can call 
voice_synthesis.cs.VoiceSynthesis.Speak("Voice Synthesis (Nuance* Vocalizer Expressive*)",0,<TEXT TO OUTPUT>,100,100,80);
to output it to audio.
I had to change my API compatibility level from ' .NET 2.0 subset' to '.Net 2.0' in the player settings to remove an error.

0 Kudos
Akshay_A_
Beginner
406 Views

@Joel C.

Thanks for your advice.. But i am still having the issue that no soud is being played.. When i run my project it is not  giving any output and also no error or warnings are reported..

Can you help me with it..

Thanks
Akshay

0 Kudos
Akshay_A_
Beginner
406 Views

@joel C.

I fixed that..... 


Thanks for all your help.. I was just having the error in passing the parameters in the speak function . 

0 Kudos
Reply