Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to test Speech input in microsoft BOT?

I have integrated Speech input api (Bing Speech API) in one of the BOTs (MS BOT framework-.net) I am working on, but not sure how to test if it is working or not. Does MS Bot emulator facilitate testing it with mic? or should I use any of the channels like skype to test it? Plz assist.

Thanks

like image 837
Ashish Avatar asked Jul 27 '16 08:07

Ashish


People also ask

How do you test MS teams bot?

The most comprehensive way to test your bot is by creating an app package and uploading it to Teams. Uploading the app package to Teams is the only method to test the full functionality available to your bot, across all scopes. There are two methods for uploading your app: Use Developer Portal for Teams.

How do you measure speech recognition accuracy?

The industry standard for measuring model accuracy is word error rate (WER). WER counts the number of incorrect words identified during recognition, and divides the sum by the total number of words provided in the human-labeled transcript (N).


1 Answers

I have created a Skype bot using the record action as defined in https://docs.botframework.com/en-us/skype/calling/#calling-conversation-object-model to record audio from the user, and then perform speech-to-text with the Bing speech recognition API after the recording has been completed using the soundfile.

      private async Task OnRecordCompleted(RecordOutcomeEvent recordOutcomeEvent)
    {      
      string s = string.Empty;
                 string path = string.Empty;
                  if (recordOutcomeEvent.RecordOutcome.Outcome = Outcome.Success)
                 {
                      var record = await recordOutcomeEvent.RecordedContent;
            path =               HttpContext.Current.Server.MapPath($"~/{recordOutcomeEvent.RecordOutcome.Id}.wav");
            using (var writer = new FileStream(path, FileMode.Create))
            {
                await record.CopyToAsync(writer);
            }
            Attachment att = new Attachment()
            {
                ContentUrl = "file:///" + path,
                ContentType = "audio/wav",

            };
            s = DoSpeechReco(att);
like image 177
Matthias Kraus Avatar answered Oct 19 '22 03:10

Matthias Kraus