Software Archive
Read-only legacy content

onRecognition of PXCMSpeechRecognition.Handler dose not fire in WCF Service when hosted in IIS

Priyank_T_
Beginner
531 Views

 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";
            }           

        }

 

0 Kudos
3 Replies
Michail_S_Intel
Employee
531 Views

Hello.

Do you have RS SDK installed on IIS machine(or runtime only)? Could you provide versions?

 

Mike.

0 Kudos
AndreCarlucci
Beginner
531 Views

Is the IIS machine the same as the development one?

What user running your application pool?

0 Kudos
Priyank_T_
Beginner
531 Views

 

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

0 Kudos
Reply