Voice Recognizer Access on Kindle Fire HD 6

105 views Asked by At

I'm developing an augmentative communication application for use on Kindle Fire. I'm using Fire HD 6 as my test device. I'm working in Xamarin, C#.

I know there is a speech recognizer on the device as the microphone icon appears on the keyboard and I can use it to populate the search window. However, my andoid speech recognizer code is not working. I get the "recognizer not present" error. Here is the code that I'm working with:

public class VoiceRecognition : Activity
{
private static String TAG = "VoiceRecognition";
private const int VOICE_RECOGNITION_REQUEST_CODE = 1234;
private ListView mList;
public Handler mHandler;
private Spinner mSupportedLanguageView;

protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
mHandler = new Handler();

SetContentView(Resource.Layout.Main);
Button speakButton = FindViewById<Button>(Resource.Id.btnRecord);

// Check to see if a recognition activity is present
PackageManager pm = PackageManager;
IList<ResolveInfo> activities = pm.QueryIntentActivities(new Intent(RecognizerIntent.ActionRecognizeSpeech), 0);

if (activities.Count != 0)
speakButton.Click += speakButton_Click;
else
{
speakButton.Enabled = false;
speakButton.Text = "Recognizer not present";
}

}

This code is obviously not going to work, but I don't know where to go from here. How can I access the voice recognizer on this device?

Thanks!

2

There are 2 answers

0
Kaarel On

You could try to connect to the speech recognizer via SpeechRecognizer (most keyboard apps do that).

Another thing to try is another action when you call the RecognizerIntent activity, e.g. there is also ACTION_WEB_SEARCH.

0
Grace Feng On

However, my andoid speech recognizer code is not working. I get the "recognizer not present" error.

Seems you're using the standard speech APIs for android device, if you're sure about your code and you've enable the capabilities, and still the speech recognizer doesn't work, I think you may need to follow the official Apis for Kindle instead of following the standard android Apis.

Take a look at this official document: Alexa Voice Service API Overview, it seems it uses HTTP to send and receive JSON format messages for SpeechRecognizer. You could have a try.