juliengabryelewicz / MicrophoneVosk

Console application test in C# for speak recognition with Vosk and PortAudio
5 stars 0 forks source link

recognition fails? #1

Open surfernet2 opened 1 year ago

surfernet2 commented 1 year ago

Hi all , I downloaded the MicrophoneVosk project, I also downloaded the Italian model vosk-model-small-it-0.22 .zip , I unzipped the model , follows the code:

class Program { static StreamParameters oParams; static Model model = new Model(@"C:\vosk-model-small-it-0.22\vosk-model-small-it-0.22\"); static VoskRecognizer rec = new VoskRecognizer(model, 16000.0f); .......... ................ ` ,program run but when I speak recognition fails , for example
if I say "test" vosk understands "chat", if I say "prova" he means "pro", can I set something? Is the way which I configure the model correct? , thank you very much ,regards

nshmyrev commented 1 year ago

You can dump audio data to a file and listen, probably it has wrong format. It happens if driver can not force 16000 sample rate. Probably it is better to set sample rate to 44100 both in recognizer and in stream initializer.

juliengabryelewicz commented 1 year ago

Hi @surfernet2 ,

All my apologies for my late answer, I just read your issue just now (I had no internet for several days).

As @nshmyrev said, have you tried to create a file with your audio data and listen the result? I wrote 16000 sample rate because it was enough for me.

Try to change this value and see if it is better or not. If so, tell me so that i can change the code and the README file for other users.

Have a nice day.

P.S : Thank you @nshmyrev for your answer when I was out.