Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing broken builds and adding README help with installing, building… #679

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions go/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# BUILDING VOSK

To use the go bindings you first have to build vosk from source. You can build it by following the instructions on the vosk web site under Compilation from source. https://alphacephei.com/vosk/install

First you will be required to install Kaldi then vosk. Once complete you will have `libvosk.so`.


# INSTALLING VOSK GO BINDINGS


go get github.com/alphacep/vosk-api/go


# VOSK NOT INSTALLED TO SYSTEM

If the vosk headers aren't installed then use CGO_LDFLAGS environment variable to point to the headers when building and installing.

CGO_LDFLAGS="-L/opt/vosk-api/src" go get github.com/alphacep/vosk-api/go

CGO_LDFLAGS="-L/opt/vosk-api/src" go build -o vosk examples/main.go

If the vosk library isn't installed on the system then use the LD_LIBRARY_PATH environment variable to point to the so file when running.

LD_LIBRARY_PATH=/opt/vosk-api/src ./vosk

4 changes: 0 additions & 4 deletions go/go.mod
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
module github.com/alphacep/vosk-api/go

go 1.16

replace (
github.com/alphacep/vosk-api/go => ./
)
3 changes: 1 addition & 2 deletions go/vosk.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package vosk

// #cgo CPPFLAGS: -I ${SRCDIR}/../src
// #cgo LDFLAGS: -L ${SRCDIR}/../src -lvosk -ldl -lpthread
// #cgo -lvosk -ldl -lpthread
// #include <stdlib.h>
// #include <vosk_api.h>
import "C"
Expand Down