C
C#16mo 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
artya16mo ago
Have you tried the SpeechRecognitionEngine?
artya
artya16mo ago
Result from running the sample code
artya
artya16mo ago
If this isn't what you're looking for, what can't you figure out with NAudio?
Schenk
SchenkOP16mo 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
artya16mo ago
This line in the sample code:
recognizer.SetInputToDefaultAudioDevice();
recognizer.SetInputToDefaultAudioDevice();
artya
artya16mo ago
Schenk
SchenkOP16mo ago
Ahh, okay, thanks for the help, and how do you see which device is default?
artya
artya16mo ago
Windows settings
Schenk
SchenkOP16mo ago
Ahh okay thanks a lot
artya
artya16mo ago
It's just your device default audio device
artya
artya16mo ago
So whatever is selected as 'Default Device' here
Schenk
SchenkOP16mo ago
Ahh I see
artya
artya16mo 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.
Want results from more Discord servers?
Add your server