DEV Community

FrankPohl
FrankPohl

Posted on • Edited on

Sample to connect Mic input stream directly to Deepgram .NET SDK

Overview of My Submission

My submission for the category Wacky Wildcards is a console app for the Windows platform. This is an example how to use the newly introduced .NET SDK.
Most applications that use speech, be it in a Command & Control speech application or a speech recognition app, must use the audio input directly with the smallest possible latency to make the interaction with the user smooth.
The latency of the service is sufficient for these scenarios if the input stream is send directly to the SKD and from there to the service. Saving the input in a file and process this file in the service would not work.

Submission Category: Wacky Wildcards

I decided to publish this under Wacky Wildcards because it doesn't solve a problem or use case directly but helps to implement solutions that have to send the audio input directly to the DeepGram service.

Link to Code on GitHub

The code for this sample app is shared in this Git repository. Here you can also find more technical details.

Content

The console app connects the audio input of the PC directly with the deepgram speech recognition service In general a .NET Core console app can run on any platform but not in this case because the code to retrieve the audio input is platform specific In the sample I'm using NAudio which is only available on the Windows platform.

Seting everything up

To use this recognition service you have to setup a Deepgram account here https://deepgram.com/

After you have created an account you can create an API key to be used in the deepgram SDK The generated secret key is used in the source code (you'll find one there but this one does not work any longer).

In the program the NUGET packages for NAudio and the Deepgram SDK are used.

install-package Deepgram install-package NAudio

The package for DeepGram is only available as a .NET core package Therefore you…

License

The code is licensed under the Apache-2 permissive license. Please find the license file in the repository.

Additional Resources / Info

This sample targets the Windows platform but on Android or iOS you will have the same problems.
The .NET SDK from DeepGram can be used in MAUI apps on this platform too.

Top comments (0)