Quantcast
Channel: Microsoft Unified Communications Managed API SDK forum
Viewing all articles
Browse latest Browse all 889

UCMA 4.0 : SetInputToAudioStream always throws an exception when passed a SpeechRecognitionStream

$
0
0

The following code always throws an exception on SetInputToAudioStream, because 'SpStreamWrapper' invokes the length property on the 'SpeechRecognitionStream' class.. which throws a otSupportedException.  All the samples follow the below pattern, is this an issue with UCMA 4.0? 

Any thoughts? <below is example code>

Choices c = new Choices(new String[] { "later", "bye", "good-bye", "see ya", "chow" });
Grammar g = new Grammar(new GrammarBuilder(c));

SpeechRecognitionConnector rc = new SpeechRecognitionConnector();
rc.AttachFlow(call.Flow);

SpeechRecognitionStream s = rc.Start();

SpeechRecognitionEngine re = new SpeechRecognitionEngine();
re.LoadGrammar(g);

SpeechAudioFormatInfo safi = new SpeechAudioFormatInfo(16000, AudioBitsPerSample.Sixteen, System.Speech.AudioFormat.AudioChannel.Mono); 

re.SetInputToAudioStream(s, safi);

Cheers,

Trebor


Viewing all articles
Browse latest Browse all 889

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>