alphacep / vosk-api

Offline speech recognition API for Android, iOS, Raspberry Pi and servers with Python, Java, C# and Node
Apache License 2.0
8.15k stars 1.12k forks source link

Build vosk-api GO in MacOS #1627

Open sekulicd opened 2 months ago

sekulicd commented 2 months ago

How can i build vosk-api GO in MacOS? Please provide instruction if i can run vosk-api go example in MacOS?

mylordkaz commented 1 month ago

Hi, i am facing the same issue, did you found how to do ?

nshmyrev commented 1 month ago

You need to download and unpack prebuilt Vosk library from here:

https://github.com/alphacep/vosk-api/releases/download/v0.3.42/vosk-osx-0.3.42.zip

then just add the module, it will be compiled automatically

mylordkaz commented 1 month ago

Oh thank you very much.

I still got this error:

go build github.com/alphacep/vosk-api/go ../../../../go/pkg/mod/github.com/alphacep/vosk-api/go@v0.3.50/vosk.go:110:2: could not determine kind of name for C.vosk_recognizer_set_grm

could it be a miss match of version, as I am using the the latest binding 0.3.50 and the prebuild Vosk library is 0.3.42.

should I downgrade to match the version ?

I actually did downgrade to match but now when I try to build, i am getting:

ld: warning: search path '/Users/MyLord/go/pkg/mod/github.com/alphacep/vosk-api/go@v0.3.42/../src' not found

.. not really sure

nshmyrev commented 1 month ago

Yes, we do not have build for 0.3.50 yet