Berit Larsen Berit Larsen - 7 months ago 39
Android Question

How do I use CHECK_VOICE_DATA_PASS in C# with Xamarin?

For my text-to-speech app I'm trying to translate the following Java code:

if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {
myTTS = new TextToSpeech(this, this);

With Xamarin and C3 the CHECK_VOICE_DATA_PASS is unavailable, and I can't see which constant to use instead.
I haven't figured out yet what this variable even means.

How do I do something similar?


Seems those integer const definitions are missing but the string-based one are defined(?), but a quick check in the Android APIs has it defined as an int with a value of one, so how about:

public const int CHECK_VOICE_DATA_PASS = 0x00000001;

public static final int CHECK_VOICE_DATA_PASS

Added in API level 4

Indicates success when checking the installation status of the resources used by the TextToSpeech engine with the ACTION_CHECK_TTS_DATA intent.

Constant Value: 1 (0x00000001)