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

vosk.NewModel error in Golang #1638

Open
fantastic0101 opened this issue Oct 7, 2024 · 8 comments
Open

vosk.NewModel error in Golang #1638

fantastic0101 opened this issue Oct 7, 2024 · 8 comments

Comments

@fantastic0101
Copy link

Hello. everyone.

I hope you are doing well.

Now, I have encountered this problem in Golang programing.

I tried to execute the example code in Golang but there is an issue like this.

image

I already downloaded the "github.com/alphacep/vosk-api/go".

Please let me know about how to solve this issue.

Thank you.

@nshmyrev
Copy link
Collaborator

nshmyrev commented Oct 7, 2024

You probably misunderstood how imports work. You should not download github.com, better follow the example in the code.

@fantastic0101
Copy link
Author

fantastic0101 commented Oct 7, 2024

I'm trying with example/test.go.

Also I downloaded the package using 'go get' command.

The package version is 0.3.50.

@nshmyrev
Copy link
Collaborator

On the screen shot you have some strange STT.go, not really example/test.go

@theredcameron
Copy link

@nshmyrev I'm running into the exact same issue. I'm running the test code with go v1.20.6 and I get the same undefined errors for NewModel and NewRecognizer. I've also used go get github.com/alphacep/vosk-api/go to obtain the library.

@nshmyrev
Copy link
Collaborator

@theredcameron did you try the instructions please?

https://github.com/alphacep/vosk-api/tree/master/go/example#readme

@theredcameron
Copy link

@nshmyrev Yes, I did follow the instructions.
image

@theredcameron
Copy link

My apologies, I had not set CGO_ENABLED equal to 1. It was equal to 0. It works now.

@theredcameron
Copy link

@fantastic0101 Make sure the CGO_ENABLED environment variable is set to 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants