Using the sample JNI Code under swig folder of pocketsphinx, I am able to load
the library in Android Java SDK with System.LoadLibrary("pocketsphinx_jni"). I
can then successfully create a Config object and Decoder object.
I have:
Config c = new Config();
c.setString("-hmm", pathToHMMFolder);
c.setString("-lm", pathToLM);
c.setString("-dic", pathToDic);
Decoder d = new Decoder(c);
As soon as I call
d.startUtt();
the application dies. The DDMS debugger under Eclipse states: process
edu.cmu.pocketsphinx (pid 313) has died.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for responding. I had noticed that -dict problem alright but the
problem seems to be memory related. I increased the Android emulator RAM to
512Mb, heap size for Dalvik to 64 and cache partition to 64Mb and got
startUtt(), endUtt() to complete without crashing. Now I am trying to do this
and getting the process dying once again. More memory needed maybe? The sample
experimental code uses an AudioStream to open the wav file from the
javax.sound library. However I'm using RandomAccessFile since the
javax.sound library isn't included in the anroid SDK anymore
fWriter = new RandomAccessFile(pathToWav, "r");
d.startUtt();
/*byte[] b = new byte [512];
int nbytes;
while ((nbytes = fWriter.read(b)) >=0 ){
ByteBuffer bb = ByteBuffer.wrap(b, 0, nbytes);
short[] s = new short[nbytes/2];
bb.asShortBuffer().get(s);
//d.processRaw(s, false, false);
//tv.append( d.getHyp().getHypstr() + ":");
}*/
d.endUtt();
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Using the sample JNI Code under swig folder of pocketsphinx, I am able to load
the library in Android Java SDK with System.LoadLibrary("pocketsphinx_jni"). I
can then successfully create a Config object and Decoder object.
I have:
Config c = new Config();
c.setString("-hmm", pathToHMMFolder);
c.setString("-lm", pathToLM);
c.setString("-dic", pathToDic);
Decoder d = new Decoder(c);
As soon as I call
d.startUtt();
the application dies. The DDMS debugger under Eclipse states: process
edu.cmu.pocketsphinx (pid 313) has died.
Sorry, this is highly experimental code, you need to try to debug it yourself,
try to add printfs down the stack to see how far it goes.
But I highly suspect that the issue is that you are using "-dic" instead of
"-dict".
Thanks for responding. I had noticed that -dict problem alright but the
problem seems to be memory related. I increased the Android emulator RAM to
512Mb, heap size for Dalvik to 64 and cache partition to 64Mb and got
startUtt(), endUtt() to complete without crashing. Now I am trying to do this
and getting the process dying once again. More memory needed maybe? The sample
experimental code uses an AudioStream to open the wav file from the
javax.sound library. However I'm using RandomAccessFile since the
javax.sound library isn't included in the anroid SDK anymore
Well, recognizer shoudn't really take so much memory. 100mb is definitely
enough unless something goes wrong with SWIG
You can probably try more lightweight tidigits model to test recognition
first.