alphacep / vosk-api

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

Windows Go instructions do not work #1322

Open antxv opened 1 year ago

antxv commented 1 year ago

The Windows Go instructions do not work. They mostly reference linux commands, they download the wrong release file, and the linking flags has an issue. The steps below work for me. Perhaps you can just update that section with these steps.

  1. Create a vosk subdirectory under your application directory.
  2. Download a Windows release from: https://github.com/alphacep/vosk-api/releases
  3. Unzip the release file.
  4. Move all *.dll files to your application directory.
  5. Move all .lib and .h files to your vosk directory.
  6. Download a language model from: https://alphacephei.com/vosk/models
  7. Unzip the model. It has an extra top level directory that you don't need. Move the directory that contains a README file to your vosk directory.
  8. Download the vosk.go file from: https://github.com/alphacep/vosk-api/blob/master/go/vosk.go
  9. Move this file to your vosk directory and rename it to vosk_api.go.
  10. Edit this file to remove "-ldl" from the following line: // #cgo LDFLAGS: -L ${SRCDIR}/../src -lvosk -ldl -lpthread
  11. You are now ready to write Go code that uses the vosk package.
  12. When calling vosk.NewModel in your code, provide the path to the model folder.
antxv commented 1 year ago

Here are the instructions I am referring to: https://github.com/alphacep/vosk-api/blob/master/go/example/README.md