#CognitiveServices – Sample Console App to perform audio analysis using Custom Speech Service (#CRIS)

Hi !

Yesterday I wrote a post on how to create and publish an Acoustinc Model in Custom Speech Service to perform a text-to-speech process (TTS). The next step is to add some C# code in an App to use this service. For this sample I will use a sample wav file with single sentencente. When I try this file in CRIS test console I get the following result:

Clipboard07

So, it’s working. Let’s create a Console App and add the NuGet package for our platform target.

Clipboard01

Important: By default the platform configuration is set to “Any CPU”, we need to change this to x86 or x64 so we can use the Speech NuGet package without any issues.

Clipboard02

So, big surprise, this package is the same for CRIS and for BING Speech recognition (Thanks to Victor for this tip!). There is a sample WPF implementation in the GitHub repo which uses the Bing keys and architecture, I’ll continue with my CRIS sample.

Let’s work in the sample Console App. There are 3 main sections here

  • Initialize the STT client
  • Process the wav file
  • Get and process CRIS result

The next pieces of code are part sample App.

  • In the Main section I create and init the STT client using the information of my previous post
  • To process the wav file, we open and send the file using small chunks to CRIS
  • Then we need to subscribe to client events
  • In this events me show some of the client received information in the Console App

We get the following result from the running app.

Clipboard04

We can download the source code from GitHub (link)

Greetings @ Toronto (-5!)

El Bruno

References

Advertisements

2 thoughts on “#CognitiveServices – Sample Console App to perform audio analysis using Custom Speech Service (#CRIS)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s