- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I work with VoiceRecognition in RealSense Sdk. When I ran voice recognition sample from Visual Studio and after
sts=sr.StartRec(source, handler); sts was pxcmStatus.PXCM_STATUS_PARAM_UNSUPPORTED
I don't know what does it mean. How can I run it program for example?
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
demo app is working fine for me. Have you tried to change source?
It`s hard to say what may be wrong from manual...
PXC
Tomek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have created new console application from scratch and it is work fine. May be useful for someone.
class Program
{
private static List<PXCMAudioSource.DeviceInfo> devices = new List<PXCMAudioSource.DeviceInfo>();
static void Main(string[] args)
{
PXCMSession session = PXCMSession.CreateInstance();
Console.WriteLine("SDK Version {0}.{1}", session.QueryVersion().major, session.QueryVersion().minor);
PXCMSpeechRecognition sr;
pxcmStatus status = session.CreateImpl<PXCMSpeechRecognition>(out sr);
Console.WriteLine("STATUS : " + status);
PXCMSpeechRecognition.ProfileInfo pinfo;
sr.QueryProfile(0, out pinfo);
sr.SetProfile(pinfo);
String[] cmds = new String[3] { "One", "Two", "Three" };
// Build the grammar.
sr.BuildGrammarFromStringList(1, cmds, null);
// Set the active grammar.
sr.SetGrammar(1);
//sr.SetDictation();
PXCMAudioSource source;
source = session.CreateAudioSource();
source.ScanDevices();
for (int i = 0; ; i++)
{
PXCMAudioSource.DeviceInfo dinfo;
if (source.QueryDeviceInfo(i, out dinfo) < pxcmStatus.PXCM_STATUS_NO_ERROR) break;
devices.Add(dinfo);
Console.WriteLine("Device : " + dinfo.name);
}
source.SetDevice(GetCheckedSource());
PXCMSpeechRecognition.Handler handler = new PXCMSpeechRecognition.Handler();
handler.onRecognition = OnRecognition;
// sr is a PXCMSpeechRecognition instance
status = sr.StartRec(source, handler);
Console.WriteLine("AFTER start : " + status);
while (true)
{
System.Threading.Thread.Sleep(5);
}
session.Dispose();
}
public static PXCMAudioSource.DeviceInfo GetCheckedSource()
{
Console.WriteLine("SELECTED : " + devices[1].name);
return devices[1];
}
static void OnRecognition(PXCMSpeechRecognition.RecognitionData data) {
Console.WriteLine("RECOGNIZED sentence : " + data.scores[0].sentence);
Console.WriteLine("RECOGNIZED tags : " + data.scores[0].tags);
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just wondering whether your issue was resolved? if not please let me know with more details, so I can help you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I ran this program on windows 8.1. Voice recognition doesn't work on windows 7. But voice synthesis works on both OS.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page