Funnyguy77 / PocketSphinxUnityDemo

A sample Unity project showing how to use PocketSphinx.
MIT License
36 stars 12 forks source link

Recognizing another languages #20

Closed antonshkurenko closed 4 years ago

antonshkurenko commented 4 years ago

Hi,

I see, you're helping people here, that's why I decided to ask for help too :)

I'm trying to build a sample of recognizing Russian language.

I've downloaded: https://sourceforge.net/projects/cmusphinx/files/Acoustic%20and%20Language%20Models/Russian/

cmusphinx-ru-5.2.tar.gz

decompressed it, added my dictionary there, kind of:

один a dd ii n
ок oo k
семь ss je mm
сто s t oo

(something quite simple)

Compressed it back with name "ru-ru.tar", added it to the field: public string lang = "ru-ru"

And put same words to the keywords.txt (switched from the string keyword to the list)

It doesn't crash, but tt doesn't recognize anything :( What can I do wrong?

antonshkurenko commented 4 years ago

Ok, sorry for the question, I changed value in the editor, but unity still had "en-us" in the variable 🤦‍♂️. But now that model shows:

FormatException: Could not find any parsable digits.
System.ParseNumbers.StringToInt (System.String value, System.Int32 fromBase, System.Int32 flags, System.Int32* parsePos) (at <e1319b7195c343e79b385cd3aa43f5dc>:0)
System.ParseNumbers.StringToInt (System.String value, System.Int32 fromBase, System.Int32 flags) (at <e1319b7195c343e79b385cd3aa43f5dc>:0)
System.Convert.ToInt32 (System.String value, System.Int32 fromBase) (at <e1319b7195c343e79b385cd3aa43f5dc>:0)
TarCs.TarHeader.UpdateHeaderFromBytes () (at Assets/Scripts/TarReader/TarHeader.cs:110)
TarCs.UsTarHeader.UpdateHeaderFromBytes () (at Assets/Scripts/TarReader/UsTarHeader.cs:85)
TarCs.TarReader.MoveNext (System.Boolean skipData) (at Assets/Scripts/TarReader/TarReader.cs:213)
TarCs.TarReader.ReadToEnd (System.String destDirectory) (at Assets/Scripts/TarReader/TarReader.cs:45)
SphinxExample+<Decompress>d__16.MoveNext () (at Assets/Scripts/SphinxExample.cs:186)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at /Users/builduser/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)