- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The below code is for Recognizing Speech through wav file.
Currently it takes about 2 to 3 sec to recognize the file. Is there any way to reduce that time.
public void ReadFile(string InputAudioFilePath)
{
PXCMSession session = PXCMSession.CreateInstance();
// session is a PXCMSession instance.
PXCMAudioSource source = session.CreateAudioSource();
// Set the audio fie
PXCMAudioSource.DeviceInfo dinfo = new PXCMAudioSource.DeviceInfo();
dinfo.did = InputAudioFilePath;
// Set the active device
source.SetDevice(dinfo);
PXCMSpeechRecognition sr;
session.CreateImpl<PXCMSpeechRecognition>(out sr);
PXCMSpeechRecognition.ProfileInfo pinfo;
String[] cmds = new String[4] { "Switch On", "Switch Off", "Light On","Light Off" };
// Build the grammar.
sr.BuildGrammarFromStringList(1, cmds, null);
// Set the active grammar.
sr.SetGrammar(1);
sr.QueryProfile(0, out pinfo);
sr.SetProfile(pinfo);
// Set handler
PXCMSpeechRecognition.Handler handler = new PXCMSpeechRecognition.Handler();
handler.onRecognition = OnRecognition;
// Start recognition
var str = sr.StartRec(source, handler);
}
Link Copied

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page