Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
3
Question by gazou · Jan 27, 2016 at 11:08 PM · androidandroidpluginspeech

PocketSphinx Implementation in Unity for Android

Hello everyone,

I'm a PhD student and I have a Unity game that uses Pocketshinx and I want to export it for Android. First of I'm applying reverse engineering on a game app that uses Pocketsphinx in Unity. I also have limited coding skils but I need to make it work in 15 days otherwise my whole PhD will go down the drain. When I export the project on Android it kind of skips the speech recognition part. In the project I have a plugin CCIRPocketSphinx.DLL, which is custom code not written by me ( I cannot contact the one who did ) compiled for Windows as a bridge to PocketSphinx.

Also, in the root of the project, Pocketsphinx.DLL and Sphinxbase.DLL - these are the Windows DLLs for PocketSphinx and come with the SDK. For Android, they need to be .a or .so files, compiled for that platform. By asking around they gave me these options:

For moving to Android you would have to do something like we did for Windows, writing a bridge from the C# Unity scripts to PocketSphinx. It looks like PocketSphinx is available on Android at http://cmusphinx.sourceforge.net/wiki/tutorialandroid but I had a quick look at it and there seems to be quite a lot of steps to setting it up. Perhaps you might be better using the built-in Android speech kit: http://developer.android.com/reference/android/speech/SpeechRecognizer.html – it seems to stream the audio for recognition, but perhaps that can be hooked into Unity a lot easier? There’s also now a Unity Android speech recognition asset: https://www.assetstore.unity3d.com/en/#!/content/13882

Is it possible for me to make Pocketsphinx- Unity work for Android? If yes can I alter the code that I already have somehow or it would be easier for me to use the speech recognition asset?

Thanx!

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image marianomdq · Aug 25, 2016 at 06:04 PM 0
Share

How was it? Could you accomplish your goal?

avatar image RaniaSaeed · Jul 04, 2017 at 01:48 PM 0
Share

did you find and answer ? I need this too

2 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by nshmyrev · Jan 27, 2017 at 06:25 PM

Pocketsphinx can work as a unity plugin, not necessary on Android.

We have published a sample demo here:

https://github.com/cmusphinx/pocketsphinx-unity-demo

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by WrightE · Feb 24, 2020 at 05:45 PM

Sorry to necro an old thread, but since this is the first result on Google I wanted to chime in.

I've created a newer, easier to understand, version of the above demo for everyone to use: https://github.com/Funnyguy77/PocketSphinxUnityDemo

It also includes pre-compiled binary's!

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image xxmariofer · Feb 25, 2020 at 08:55 AM 0
Share

Hello! first thanks for your work, i was trying to test your project but in the method $$anonymous$$oveNext, when calling inStream.Read it never reads the last bytes and i recieve the "Can not read header" do you know what could be causing it? tested in windows and android with the same unity version (i always have 379 bytes remeaing) thanks!

also, it is posible to have the voice recognition running in the background so i can use it as a "key phrase" detector? similar to "$$anonymous$$a" or "Ok google"

avatar image WrightE xxmariofer · Feb 25, 2020 at 02:52 PM 0
Share

Hi!

Thanks for checking out the demo! That error occurs when your language model (.tar) file doesn't contain any data. The repo is using Git LFS, so you will need to clone the repo ins$$anonymous$$d of downloading the zip.

Edit: Yes it is possible to add functionality for something similar to "Ok Google" or "$$anonymous$$a". Essentially you would have to listen to the microphone at all times and record when a user starts speaking. Once you have the audio file, you can simply check it with Sphinx and deter$$anonymous$$e what the user said. If they say "Ok Google" for example, you can have the program respond with something.

Hope that helps!

avatar image xxmariofer WrightE · Mar 02, 2020 at 11:13 AM 0
Share

hello sorry for the really late response but i was unable to test it before, i did clone the repository, i didnt download it, i have test twice without luck, i have tried to uncompress the en-us.tar file manually using z-zip and it sais the file is corrupted, i have tried to open other tar files in case it was a problem with my pc and it worked just fine, yoou think that could be the problem?

i have checked and when i read the tar it says its lenght is 133, but the header.headerSize is bigger (512)

any help is appreciate it!

Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

10 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Android plugin in thread 1 Answer

How to put a permanent notification on phone? 0 Answers

Using the MPFR number library on Android 0 Answers

Unable to convert classes into dex format 1 Answer

My Android Game is not working (unity 19.2) 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges