- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi,
while going through the documentation for speech synthesis, I found a code snippet where we are asked to write a code to send audio to the audio device.Can anyone tell me how to do that. my code is C#
Thanks,
Shaleen
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please looked at the sample code @C:\Program Files (x86)\Intel\RSSDK\framework\CSharp\voice_synthesis.cs Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi,
I dont understand the program structure in the speech synthesis sample. I have the text in a string, just want to send it to audio source.
How can I do that?
Thanks,
Shaleen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Shaleen,
If you go and read through documentation, its all easy. However if you are still unable to understand structure of code, do follow this simple steps.
- Navigate to <Installation_DIR>\RSSDK\framework\CSharp\voice_synthesis.cs
- Copy VoiceOut.cs and VoiceSynthesis.cs files to your project directory.
- Use this function string sts=VoiceSynthesis.Speak("Voice Synthesis (Nuance* Vocalizer Expressive*)",<LANG_CODE>,<your string for synthesis here>, curr_volume, curr_pitch, curr_speech_rate);
sts is string value containing status of device. (for debug purpose).
"Voice Synthesis (Nuance* Vocalizer Expressive*)" is a string value specifying your depth camera.
Where default value for curr_volume, curr_pitch & curr_speech_rate is 100,100,80 respectively. You may change it, if required.
LANG_CODE is 0 For English.
These values are passed to static Speak function written in VoiceSynthesis.cs, therefore you can call it directly without creating instance of class VoiceSynthesis. Make sure that you are using proper namespaces.
It may help you code your logic faster. Once it works, make sure you go through these two files as well documentation.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Sahil,
Thanks for the reply.
I tried calling the Speak function but kept on getting an error:"failed to create the synthesis module".
here's the code I tried. I did include System.Media.
static void Main(string[] args) { string sts= voice_synthesis.cs.VoiceSynthesis.Speak("Voice Synthesis(Nuance* Vocalizer Expressive*)", 0, "Hello", 80, 100, 100); Console.WriteLine(sts); Console.ReadLine(); }
Also, are the participant allowed to import class files from the samples directly?
I found little help in the samples but the documentation doed not seem to touch upon the details. There was no mention of Nuance module and it talked about using buffers .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is an easy fix. You are missing the space between Synthesis and (. Should be "Voice Synthesis (Nuance* Vocalizer Expressive*)"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Jonathan,
Thanks for the reply.
I tried implementing your solution but it still didn't work.
Here's the new snippet:
string sts = voice_synthesis.cs.VoiceSynthesis.Speak("Voice Synthesis (Nuance* Vocalizer Expressive*)", 1, "Hello", 80, 100, 100); if (sts != null) MessageBox.Show(sts);
Pls suggest something.
Thanks,
Shaleen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Looks like you changed your language code from 0 to 1. Try changing it back to 0.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page