- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
onRecognition of PXCMSpeechRecognition.Handler dose not fire in WCF Service when hosted in IIS. The handler is called in development environment but it is not called when deployed in IIS.
See Below Code.
bool HasSpeechRecognised = false;
string SpeechText = string.Empty;
public string GetText(Byte[] value)
{
PXCMSession session = PXCMSession.CreateInstance();
// session is a PXCMSession instance.
var FileName = @"D:\Test\ServiceInput.wav";
System.IO.File.WriteAllBytes(FileName, value);
PXCMAudioSource source = session.CreateAudioSource();
// Set the audio fie
PXCMAudioSource.DeviceInfo dinfo = new PXCMAudioSource.DeviceInfo();
dinfo.did = FileName;
// Set the active device
source.SetDevice(dinfo);
PXCMSpeechRecognition sr;
session.CreateImpl<PXCMSpeechRecognition>(out sr);
PXCMSpeechRecognition.ProfileInfo pinfo;
sr.QueryProfile(0, out pinfo);
sr.SetProfile(pinfo);
// Set handler
PXCMSpeechRecognition.Handler handler = new PXCMSpeechRecognition.Handler();
handler.onRecognition = OnRecognition;
// Start recognition
var Status = sr.StartRec(source, handler);
while (!HasSpeechRecognised)
{
}
sr.StopRec();
sr.Dispose();
session.Dispose();
return SpeechText;
}
private void OnRecognition(PXCMSpeechRecognition.RecognitionData data)
{
HasSpeechRecognised = true;
// Process Recognition Data
var d = data;
if (d.scores.Length >= 1)
{
SpeechText = d.scores[0].sentence;
}
else
{
SpeechText = "Invalid Audio";
}
}
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello.
Do you have RS SDK installed on IIS machine(or runtime only)? Could you provide versions?
Mike.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is the IIS machine the same as the development one?
What user running your application pool?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1. RS SDK is installed on IIS machine (Windows 8.1 , IIS 8, RS 4.0.0.112526)
2. Yes this IIS machine the same as the development one.
3. Application pool identity is LocalSystem
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page