Nader Hijazi
unread,Aug 18, 2014, 3:58:18 PM8/18/14Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to uni...@googlegroups.com
Hi all, Vali,
Unfortunately, the c# wrapper only comes with the class UniSynth which is a sample application for TTS.
I have created a sample recognition (ASR) test application by streaming an audio file, by using similar objects used in UniSynth but replacing the channel and stream UniMRCPRecognizerChannel, UniMRCPStreamRx, and UniMRCPAudioTermination to build it, but the Speech Server does not throw any START-OF-INPUT event.
It times out throwing the event RECOGNIZER_RECOGNITION_COMPLETE with a completion reason: 002 no-input-timeout
I wanted to have a proof of concept that the c# wrapper can do MRCP recognition, in order to incorporate it in our solution. No luck so far.
I have looked into the C code in UniMRCP for the demo_recog to see if there is any conceptual difference with the C# wrapper but I couldn't find any.
Also, I have tried to swig the demo_recog code to create a C# Wrapper but No Luck also.
Could you kindly give me a hand?
Here is an overview of what I did:
----------------------------------
- For the configuration and profiles, I believe I have everything in place (tested the same configuration in UniMRCP and it works fine for both TTS and Recognition)
- For the Audio file, I am using the same file provided by the UniMRCP demo_recog sample (one-8kHz.pcm) which works with the demo
- For the scenario I am following scenario
@subsection sec-recog1 Simple Recognition
* <pre>
* C>S: Send RECOGNIZE message with Content-Type header and body with grammar.
* UniMRCPClientChannel::OnAdd
* C<S: Receive IN-PROGRESS response.
* UniMRCPRecognizerChannel::OnMessageReceive
* (Client now sends audio and/or DTMF to recognize.) UniMRCPStreamRx::ReadFrame
* C<S: May receive START-OF-INPUT event.
* UniMRCPRecognizerChannel::OnMessageReceive
* C<S: Receive RECOGNITION-COMPLETE event.
* UniMRCPRecognizerChannel::OnMessageReceive
* </pre>
- In UniMRCPStreamRx, I have overridden the constructor and ReadFrame() to read an audio file and call SetData() in order to stream the audio to the speech server as follows:
public class RecogStream : UniMRCPStreamRx
{
public bool streaming = false;
// Buffer to copy audio data to
private byte[] buf = null;
private FileStream f = null;
public RecogStream(string filename)
{
f = new FileStream(filename, FileMode.Open, FileAccess.Read);
}
public override bool ReadFrame()
{
if (streaming)
{
if (f != null)
{
uint frameSize = GetDataSize();
buf = new byte[frameSize];
//
int readcount = f.Read(buf, 0, Convert.ToInt32(frameSize));
if (readcount > 0)
{
//Console.Write("{0} - ReadFrame [{1} bytes]", this, readcount);
SetData(buf, (uint)readcount);
if (readcount != frameSize)
{
Console.Write("- Done reading file: Last ReadFrame [{1} bytes]", this, readcount);
streaming = false;
//SendDTMF('2');
}
}
else
{
streaming = false;
}
}
}
return true;
}
--
This e-mail (including any attachments) is for the sole use of the intended
recipient(s) and may contain information that is confidential and/or
protected by legal privilege. Any unauthorized review, use, copy,
disclosure or distribution of this e-mail is strictly prohibited. If you
are not the intended recipient, please notify Mitel immediately and destroy
all copies of this e-mail. Mitel does not accept any liability for breach
of security, error or virus that may result from the transmission of this
message.