Coder Social home page Coder Social logo

yeti47 / vosk4unity Goto Github PK

View Code? Open in Web Editor NEW
24.0 3.0 5.0 131 KB

Vosk4Unity is a module for the Unity Engine that provides a simple way to integrate speech recognition into your application. It is based on and powered by the Vosk speech recognition engine.

License: MIT License

C# 100.00%
speech-recognition stt speech-to-text voice-recognition voice-commands voice command keyword-detection

vosk4unity's Introduction

Vosk4Unity

Vosk4Unity is a module for the Unity Engine that provides a simple way to integrate speech recognition into your application. It is based on and powered by the Vosk speech recognition engine.

Vosk4Unity can be used with any Vosk-compatible speech recognition model and even provides an in-editor GUI for downloading and managing models. This allows for a very quick and easy setup.

Target Platform Support

The current development version only supports Windows x64 as the target build platform. Eventually, there will be two separate releases. One for targeting Windows 64-bit platforms and one for Windows x86 platforms. Any other target platforms, such as Linux, Android or macOS are currently not supported.

If you do need to build for 32-bit Windows clients, you can use the following work-around for now:

  • Download the Windows 32-bit release of the official vosk-api here.
  • Go into the folder 'Assets/lib' and replace the .dll files with the ones you downloaded
  • Recompile

vosk4unity's People

Contributors

yeti47 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vosk4unity's Issues

Error on opening the Unity project!

Hi,
I get errors on opening the unity project!
It seems the unity can't read the "Vosk.dll" file in the "lib" folder!
There are three main errors in total that all of them are related to "using Vosk;" in the "VoskListener.cs" script!
Could you please help me to solve this issue?
I am using Unity 2021.1.21f1 (the exact version that you created the project with it)...
I'm looking forward to your comment.
Thank you so much for your attention.
Kind Regards,
Stig

#####################
Problem SOLVED!
I had to download all the dlls from the Vosk-API repository and replace them with the one in this repo...

THANK YOU AGAIN for this amazing project :-) ...

Unable to import models via Vosk Model Manager

Under the Import new models section of the Vosk Model Manager with the Source set as alphacephei.com selecting Show available models does not work. It throws an exception

System.Xml.XmlTextReaderImpl.Throw (System.Exception e) (at <18ec6be538e24196bb0c8cd722440d04>:0)
System.Xml.XmlTextReaderImpl.Throw (System.String res, System.String arg) (at <18ec6be538e24196bb0c8cd722440d04>:0)
System.Xml.XmlTextReaderImpl.Throw (System.Int32 pos, System.String res) (at <18ec6be538e24196bb0c8cd722440d04>:0)
System.Xml.XmlTextReaderImpl.ParseDocumentContent () (at <18ec6be538e24196bb0c8cd722440d04>:0)
System.Xml.XmlTextReaderImpl.Read () (at <18ec6be538e24196bb0c8cd722440d04>:0)
System.Xml.Linq.XElement.ReadElementFrom (System.Xml.XmlReader r, System.Xml.Linq.LoadOptions o) (at <2167034a298f454682b17f19f69d5cb2>:0)
System.Xml.Linq.XElement..ctor (System.Xml.XmlReader r, System.Xml.Linq.LoadOptions o) (at <2167034a298f454682b17f19f69d5cb2>:0)
System.Xml.Linq.XElement.Load (System.Xml.XmlReader reader, System.Xml.Linq.LoadOptions options) (at <2167034a298f454682b17f19f69d5cb2>:0)
System.Xml.Linq.XElement.Parse (System.String text, System.Xml.Linq.LoadOptions options) (at <2167034a298f454682b17f19f69d5cb2>:0)
System.Xml.Linq.XElement.Parse (System.String text) (at <2167034a298f454682b17f19f69d5cb2>:0)
Yetibyte.Unity.SpeechRecognition.ModelManagement.HttpVoskModelProvider+<>c__DisplayClass14_0.<FetchModels>b__0 (UnityEngine.AsyncOperation op) (at Assets/Vosk4Unity/Src/Yetibyte.Unity.SpeechRecognition/ModelManagement/HttpVoskModelProvider.cs:57)
UnityEngine.AsyncOperation.InvokeCompletionEvent () (at <2ec790438a214ee286016c37f7604299>:0)

importing models manually works fine and even shows the Delete action in the Local models section

Compiler errors when opening in Unity, Vosk.dll not referenced?

Hello,

First of all, this is a really cool project and exactly what I was looking for for quite a while but unable to do myself, so thanks for doing the work! (I'm looking to use Vosk in a VR game prototype that runs both on Windows and Oculus Quest standalone)

I hope it's okay to open an issue here. I tried opening the project in the correct Unity version, however, I get 3 compiler errors because the types/namespaces 'Vosk', 'VoskRecognizer' and 'Model' can't be found.

I assumed this was caused by the Vosk.dll not loading correctly / not being referenced in the assembly definition for some reason. The assembly definition has indeed a missing reference but I can't reference anything vosk related. I can't include them as assembly references with 'Override References' either.

Also when I tried to enable 'Load on startup' on the vosk.dll and the other libraries in the project, they all throw an exception along the lines of:

Failed to load 'Assets/lib/Vosk.dll', expected x64 architecture, but was Unknown architecture. You must recompile your plugin for x64 architecture.

Vosk is available in 64bit though right? And Unity has phased out 32bit for quite a while now, so I assume something is wrong here and the libraries should not really be 32bit?

Any help would be greatly appreciated!

Cheers, Alex

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.