C
C#2y ago
Schenk

Real-time audio recording and streaming

Hey, so I'm trying to make a home assistant like console app, but I'm having issues with the voice recording, I would like it to record real-time audio and then stream that to a real-time speech to text api, would this be possible, is so does anybody any resources on how to achieve it. I have looked at using NAudio but i can figure out how.
14 Replies
artya
artya2y ago
Have you tried the SpeechRecognitionEngine?
artya
artya2y ago
Result from running the sample code
artya
artya2y ago
If this isn't what you're looking for, what can't you figure out with NAudio?
Schenk
SchenkOP2y ago
Maybe, how do you see which input device it uses, because my results are very bad, but that might be because is uses the wrong input device it does look like what i need, but for some reason it has a really hard time understanding what i say... Ohh, I see, I can train it in the control panel to work better with my voice, okay thanks a lot, i will try that later. Thanks
artya
artya2y ago
This line in the sample code:
recognizer.SetInputToDefaultAudioDevice();
recognizer.SetInputToDefaultAudioDevice();
artya
artya2y ago
Schenk
SchenkOP2y ago
Ahh, okay, thanks for the help, and how do you see which device is default?
artya
artya2y ago
Windows settings
Schenk
SchenkOP2y ago
Ahh okay thanks a lot
artya
artya2y ago
It's just your device default audio device
artya
artya2y ago
So whatever is selected as 'Default Device' here
Schenk
SchenkOP2y ago
Ahh I see
artya
artya2y ago
If you want to check default device in your code and let's say set the default device to a different device if your default device isn't the device you want to use (this is confusing to type.) You can use NAudio to retrieve default device name, and set a desired device as the default.

Did you find this page helpful?