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