I want to implement a keyword spotting based on PocketSphinx for an Android app.
PocketSphinx is new for me. I started with the PocketsphinxAndroidDemo from their repo.
Then I have imported the project in Eclipse and have build and deployed the demo app on my phone. The demo recognized the commands deposit and withdraw and numbers fine. I have not installed any other lib or tool.
Now I want to recognize my own keywords and follew the CMUSphinx tutorial. Therefore I created an own DIC and LM file using "Sphinx knowledge base generator" and have included in the assets subfolder of the project. The corpus I use:
open browser
new e-mail
forward
backward
next window
last window
open music player
I have modified SpeechRecognizer the following:
config.setString("-jsgf", joinPath(dataDir, "dialog.gram")); // unmodified
config.setString("-dict", joinPath(dataDir, "lm/2914.dic"));
config.setString("-lm", joinPath(dataDir, "lm/2914.lm"));
config.setString("-hmm", joinPath(dataDir, "hmm/hub4wsj_sc_8k")); // unmodified
Then I have started the app again and got the following errors:
11-21 12:48:18.758: E/cmusphinx(15521): "fsg_search.c", line 334: The word 'withdraw' is missing in the dictionary
and
11-21 12:48:26.375: A/libc(15521): Fatal signal 11 (SIGSEGV) at 0x0000001c (code=1), thread 15557 (SpeechRecognize)
I know "withdraw" is a word of the former dictionary.
What do I have to modify in the grammar file?
I also read this tutorial http://www.aiaioo.com/cms/index.php?id=28 and used the acoustic model and the phonetic dictionary from there. I have modified the SpeechRecognizer again. While the app is starting, I see the ressources were loaded correctly. But then I got the same error.
Can someone please tell me please what the problem is?
What steps do I have to do to get my spotting running?
Try to change entries in a dictionary file to ALL CAPS. Try using this for your dictionary file:
OPEN BROWSER
NEW E-MAIL
FORWARD
BACKWARD
NEXT WINDOW
LAST WINDOW
OPEN MUSIC PLAYER
This worked for me.
Related
A third party created a unity project for me but they lost their project on their end. A guy had it on his laptop, never backed it up but he did send the integrated unity project for android. The only issue is that we need to change something inside it. So I have the android project, I just need the built unity's source code.
The same situation occurred with our IOS version, luckily Xcode had the Assembly-Csharp accessible and I could find the value I needed to change. The Android's Unity was built with il2cpp. I've managed to re-secure the assets using some tools I've found online. So I can potentially rebuild the project with new scripts. However this may take a rather large amount of time. So I found I can edit the source code through the hex code, but this seems limited/nigh impossible as I need to make a condition on this string instead of simply setting the value. If there is a way to do this with a hex editor on the lib2cpp.so file I would greatly appreciate even a lead. Alternatively I have found some things on hooking a string, but I am unsure of how to go about this and cannot find sources of where to start such a thing.
Any leads or information on how to edit a string on a condition in the unity source code through it's lib2cpp.so file or libunity.so file would be greatly appreciated!
I'll try to make this simple :
If I create an AIR app from the Flash IDE, I can choose to embed folder in my package. Then I can load the files using 'app:/'+filename. Everything is ok.
I have to move to Flash Builder because I can't test workers in the IDE (thanks Adobe). My issue is that, if I test/debug from Flash Builder, it does a stream error when calling 'app:/'+filename. If I launch the test in the IDE from FB, it works but the Workers don't. I should mention, the reason I'm using this method is that I have so many graphical assets, it's just easier to maintain/update this way instead of using [Embed.. ] for all my items, and it just works in the IDE...
I've added my folder to my sources locations in Flash Builder, still it seems I cannot use the 'app:/' thing.
How can I make this work so I don't change my code and still use 'app:/'? FB is such a confusing program...
edit : I tested again the workers in the IDE build launched by FB (the test in flash IDE icon), I can trace its state with :
worker.start();
worker.addEventListener(Event.WORKER_STATE, this._handleWorkerState);
private function _handleWorkerState(__e:Event):void{
trace(__e.currentTarget.state);
}
traces 'new' then 'running'. But for some reason, it doesn't send or receive any data from any message channel, which, again, works in FB4.7 when i run a debug but doesn't find my files....
Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: app:/foldername..
So basically, I'm looking for a solution to at least one of my problems :)
EDIT :
So ok. Here it is, one issue was due to the wrong debugger version installed (for the workers part). So I can now work and compile in the IDE again. I haven't found an answer to why 'app:/' doesn't work from FB4.7. So that would be the remaining question.
One option since you have Flash IDE is to create a library with all of your images. Drop all your images into the library in Flash and export them for actionscript. Then publish and create a a SWC. Then you can use the swc, which is kind of like a zip file for display objects, in flashbuilder and access them like:
var mc:MovieClip = new imageExportedForAS3_1()
Create a top level folder in your flex project called for example images, copy all of your images into that folder, then every time you need to load an image, just use the source attribute and use the absoulte rute, for example.
<mx:Image source="#Embed(source='../images/pic.png')"
I have never used the app:/ sentence before! Good luck!
I am having some difficulties with my android app parsing an xml that contains links to PDF files. It should open a listView showing all of the files listed in the xml. However, most of the time it just freezes up on me. The app was made by a developer no longer with us, and all I have is the apk and not the source files. Is there a way to use the apk to get the source files and figure out what the issue is? Android is not my forte and I'm at a loss with how to fix this.
UPDATE:
It appears that devices running 2.2 display all the songs just fine, while the newer versions of Android crash when ran.
I've had problems with android 2.2 on my HTC desire taking a long time to parse large XML files. There wasn't much I could do other than switch from DOM to SAX which for some reason was a lot quicker
However debugging this without source code is likely to be pretty difficult. Not least because fixing the issue when and if you find it will require you to re-compile a new class in replacement for the one which keeps freezing.
I would suggest you look into decompiling the APK back into source code.
According to Wikipedia APK files are based on the Jar file format which in turn is a Zip file:
http://en.wikipedia.org/wiki/APK_%28file_format%29
That makes this task a little easier as you won't need to look for a decompiler that is specific to android but a more generic Java Decompiler.
A quick search on google suggests this one:
http://java.decompiler.free.fr/
If you can decompile the app back to source code and then get that source code into eclipse and rebulild from source then you can start to debug.
I try to download and run the offline voice recognization demo from this link - http://cmusphinx.sourceforge.net/2011/05/building-pocketsphinx-on-android/ . I m successfully install and run this demo project on device, but when i push and hold the button and when i release the button, it try to convert into text. The textfield "Your text goes here" becomes empty but it is not displaying the any result, i.e. Text of What we speak.
Please any one who run this demo successfully, help me with better suggestion.
Thanks in advance.
In my experience, the text field stays blank when there is some error in the configuration for the native pocket sphinx code. Any errors encountered by PocketSphinx should be printed to the log file. Figure out where your PocketSphinx log file is; it is set using the setLogfile(String path) function. One of the things that happens to me quite often is a mismatch between the words in the dictionary and the words in the language model/grammar. Since you probably haven't edited those, I'd say it could be a wrong path to one of them. The log file will tell you about anything that couldn't be loaded.
If you go into the standard Note pad accessory application, the first available note menu entry is going to be...
<untitled>
My question is this: Where is "<untitled>" coming from in the code? The code is in the NotePad sample in the SDK if you want to built a project from existing source real fast. I just can't find where "<untitled>" is spelled out anywhere in the source or resources.
(Else, is this instead some kind of ultra low level string that Android's API hands to the GUI if there's nothing specified for a title? Which can't be changed?)
In the NotePadProvider.java appears that this string cames from android.R.string. To find that file you need to go here: SDKpath/platforms/version_you_are_programming/data/res/values. There is the string.xml file and that file is internal to the OS, I doubt you can change it.