vosk-api icon indicating copy to clipboard operation
vosk-api copied to clipboard

Error when use C# nuget package

Open broteam168 opened this issue 5 years ago • 45 comments

I have download your nuget package(https://www.nuget.org/packages/Vosk/) and add it to my project but when running i have received this error: 'The type initializer for 'Kaldi.VoskPINVOKE' threw an exception.' when i run this line code: Model model = new Model("C:\Users\Admin\Desktop\vosk-model-small-vn-0.3"); image

broteam168 avatar Dec 20 '20 12:12 broteam168

Our nuget supports just linux unfortunately, we might add support for windows later.

nshmyrev avatar Dec 20 '20 16:12 nshmyrev

Thank for answer and i think you should update it soon.I will use this in my robot project.

I have met a new error when use Makefile in Cs folder. No rule for /src/vosk.i (something like this )

broteam168 avatar Dec 21 '20 02:12 broteam168

No rule for /src/vosk.i (something like this )

Source folder variable is empty in makefile, thats why you have /. You need to substitute path properly I think. You also need swig and kaldi build.

nshmyrev avatar Dec 21 '20 08:12 nshmyrev

:Thank you for all your answers.

Your nuget package is from Makefile in CS folder, isn't it?

broteam168 avatar Dec 22 '20 02:12 broteam168

Your nuget package is from Makefile in CS folder, isn't it?

Makefile creates a dll, then you can just use "nuget pack". You can create a similar dll on windows with mingw.

We will do it a bit later, just need some more time.

nshmyrev avatar Dec 22 '20 21:12 nshmyrev

Any update on Windows version?

PatrykSajdok avatar Jan 05 '21 15:01 PatrykSajdok

TT any update on Window???? it is very neccessary to me!!!!!!!!

broteam168 avatar Jan 09 '21 13:01 broteam168

Hey guys, a bit more patience please, it will be ready soon.

nshmyrev avatar Jan 09 '21 14:01 nshmyrev

@broteam168
Hi Excuse me, I did the same thing, but my error did not go away. What should I do to get rid of my error?

@doctorwho-123 you can give more information about your situation?

broteam168 avatar Jan 14 '21 02:01 broteam168

@broteam168 I want to run this vosk api to convert speech to text for English in Visual Studio C# environment or how can I compile this vosk api ? https://github.com/alphacep/vosk-api/blob/master/csharp/test.cs My goal is to come and say something through the microphone and convert that code into text using vosk.

you can install C# nuget package from Visual studio using command line or GUI. Then you copy that code to your project(notice this nuget package only run on linux) . Run and feel your result @doctorwho-123

broteam168 avatar Jan 15 '21 13:01 broteam168

tahnks @broteam168 Do I want to run or compile vosk api use visual staduio c# in Windows? What should I do? I am a beginner in this field? Help me please ?

In case this help you, what I did, although it is hacky, might help you meanwhile they get a nudget package working on windows.

I installed vosk with python and from my c# vs2019 solution captured a converted the voice into a wav file and executed a python script getting the result back into my c# program.

I can try to publish and example in GitHub if you are interested.

alvaromongon avatar Jan 15 '21 21:01 alvaromongon

@alvaromongon Hello, please explain this step by step using C # code and ... with example and image for visual studio c# in windows .

I will try to set up an example in a GitHub repo during this weekend so you can analyze the code.

alvaromongon avatar Jan 15 '21 21:01 alvaromongon

Here you have it @doctorwho-123

https://github.com/alvaromongon/windows-csharp-vosk-api

Read the readme first, there are some dependencies.

alvaromongon avatar Jan 16 '21 19:01 alvaromongon

@alvaromongon Thank you very much. How can I replace the Spanish model with an English model?

I have updated the information in the readme.md file about how the Vosk is used and where should it be located.

Please take a look and investigate.

alvaromongon avatar Jan 17 '21 08:01 alvaromongon

@nshmyrev Can you give me a time for this update? I want to have a plan with this!!

broteam168 avatar Jan 23 '21 09:01 broteam168