We're using pocketsphinx to help us convert .wav files into text files. We don't know why it gives us a strange output as it gives us only <s> and </s> after the conversion. We're using the default dictionary, langauge model and acoustic model given by the cmusphinx community.
final File file = new File(AudioToConvert.pathko);
Uri uri = Uri.fromFile(file);
File auxFile = new File(uri.getPath());
stream = new FileInputStream(auxFile);
From it you seem to process directory object instead of actual wav file. I'm not sure why do you need "auxFile". You can count the number of processed bytes in order to ensure you process the wav file.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
We removed the Uri uri = Uri.fromFile(file); and stream = new FileInputStream(auxFile); from the code yet we still got no success on the conversion process.
Here is the updated logcat after we tried the solution stated above:
We're using pocketsphinx to help us convert .wav files into text files. We don't know why it gives us a strange output as it gives us only
<s>
and</s>
after the conversion. We're using the default dictionary, langauge model and acoustic model given by the cmusphinx community.Here is the code we're using for the conversion:
And here is the logcat when we execute the conversion process:
Last edit: Nickolay V. Shmyrev 2016-10-17
You need to add
See
http://stackoverflow.com/questions/29008111/give-a-file-as-input-to-pocketsphinx-on-android
We've included the code you gave, but unfortunately the result is still the same.
You need to provide an updated log then. The important piece is
With proper byorder CMN estimate should be less than 60.
This is the updated logcat we've got after we executed the newly updated conversion process:
Last edit: Randall Castillo 2016-10-17
You need to provide a complete updated log
I updated my previous post with the complete logcat.
This piece of code also looks suspicious
From it you seem to process directory object instead of actual wav file. I'm not sure why do you need "auxFile". You can count the number of processed bytes in order to ensure you process the wav file.
We removed the
Uri uri = Uri.fromFile(file);
andstream = new FileInputStream(auxFile);
from the code yet we still got no success on the conversion process.Here is the updated logcat after we tried the solution stated above:
Also we downloaded a 16khz .wav file and it converted successfully. We think there is a problem on our recording process, and maybe it has wrong khz.
Here is our code for the recording .wav file.
You can not use MediaRecorder to record PCM data, you have to use low level AudioRecord instead.
May I please know what is the optimal samplerate for pocketsphinx android?
16000
Is there any way to use .gram files in decoder?
For example:
You need to use
-jsgf
instead of-lm
:Thank you so much, Mr. Nikolay!