I\'m using the SpeechRecognizer via Intent:
Intent i = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH);
i.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL
I haven't work with speech reorganization. But still, as you said you are getting float array value as 0.0, this implies float array is null . can you please check is the float[] is returning null or else.
ArrayList results = data
.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
float[] confidence = data.getFloatArrayExtra(
RecognizerIntent.EXTRA_CONFIDENCE_SCORES);
if (confidence == null)
{
for (int i = 0; i < results.size(); i++)
{
Log.d(TAG, i + ": " + results.get(i));
}
}
else
{
for (int i = 0; i < results.size(); i++)
{
Log.d(TAG, i + ": " + heard.get(i) + " confidence : " + confidence[i]);
}
}
Can you please check the book Professional Android Sensor Programming By Greg Milette, Adam Stroud this will surely help you. You will get some details on page 394 on this book.