Merge change 7134 into donut

* changes:
  Unhide required definitions in TextToSpeech.Engine that cover return codes and extras for android.intent.action.CHECK_TTS_DATA intent, and the key values for the parameter hashmap that can be passed by an application in speak(), synthesizeToFile(), playSilence() and playEarcon().
This commit is contained in:
Android (Google) Code Review
2009-07-14 17:43:58 -07:00
2 changed files with 229 additions and 3 deletions

View File

@@ -111383,6 +111383,144 @@
> >
</field> </field>
</class> </class>
<class name="TextToSpeech.Engine"
extends="java.lang.Object"
abstract="false"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
<constructor name="TextToSpeech.Engine"
type="android.speech.tts.TextToSpeech.Engine"
static="false"
final="false"
deprecated="not deprecated"
visibility="public"
>
</constructor>
<field name="CHECK_VOICE_DATA_BAD_DATA"
type="int"
transient="false"
volatile="false"
value="-1"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="CHECK_VOICE_DATA_FAIL"
type="int"
transient="false"
volatile="false"
value="0"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="CHECK_VOICE_DATA_MISSING_DATA"
type="int"
transient="false"
volatile="false"
value="-2"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="CHECK_VOICE_DATA_MISSING_VOLUME"
type="int"
transient="false"
volatile="false"
value="-3"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="CHECK_VOICE_DATA_PASS"
type="int"
transient="false"
volatile="false"
value="1"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="TTS_DEFAULT_STREAM"
type="int"
transient="false"
volatile="false"
value="3"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="TTS_KEY_PARAM_STREAM"
type="java.lang.String"
transient="false"
volatile="false"
value="&quot;streamType&quot;"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="TTS_KEY_PARAM_UTTERANCE_ID"
type="java.lang.String"
transient="false"
volatile="false"
value="&quot;utteranceId&quot;"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="VOICE_DATA_FILES"
type="java.lang.String"
transient="false"
volatile="false"
value="&quot;dataFiles&quot;"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="VOICE_DATA_FILES_INFO"
type="java.lang.String"
transient="false"
volatile="false"
value="&quot;dataFilesInfo&quot;"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
<field name="VOICE_DATA_ROOT_DIRECTORY"
type="java.lang.String"
transient="false"
volatile="false"
value="&quot;dataRoot&quot;"
static="true"
final="true"
deprecated="not deprecated"
visibility="public"
>
</field>
</class>
<interface name="TextToSpeech.OnInitListener" <interface name="TextToSpeech.OnInitListener"
abstract="true" abstract="true"
static="true" static="true"

View File

@@ -113,43 +113,131 @@ public class TextToSpeech {
/** /**
* Internal constants for the TTS functionality * Internal constants for the TTS functionality
* *
* {@hide}
*/ */
public class Engine { public class Engine {
// default values for a TTS engine when settings are not found in the provider // default values for a TTS engine when settings are not found in the provider
/**
* {@hide}
*/
public static final int FALLBACK_TTS_DEFAULT_RATE = 100; // 1x public static final int FALLBACK_TTS_DEFAULT_RATE = 100; // 1x
/**
* {@hide}
*/
public static final int FALLBACK_TTS_DEFAULT_PITCH = 100;// 1x public static final int FALLBACK_TTS_DEFAULT_PITCH = 100;// 1x
/**
* {@hide}
*/
public static final int FALLBACK_TTS_USE_DEFAULTS = 0; // false public static final int FALLBACK_TTS_USE_DEFAULTS = 0; // false
/**
* {@hide}
*/
public static final String FALLBACK_TTS_DEFAULT_SYNTH = "com.svox.pico"; public static final String FALLBACK_TTS_DEFAULT_SYNTH = "com.svox.pico";
// default values for rendering // default values for rendering
public static final int TTS_DEFAULT_STREAM = AudioManager.STREAM_MUSIC; public static final int TTS_DEFAULT_STREAM = AudioManager.STREAM_MUSIC;
// return codes for a TTS engine's check data activity // return codes for a TTS engine's check data activity
/**
* Indicates success when checking the installation status of the resources used by the
* text-to-speech engine with the android.intent.action.CHECK_TTS_DATA intent.
*/
public static final int CHECK_VOICE_DATA_PASS = 1; public static final int CHECK_VOICE_DATA_PASS = 1;
/**
* Indicates failure when checking the installation status of the resources used by the
* text-to-speech engine with the android.intent.action.CHECK_TTS_DATA intent.
*/
public static final int CHECK_VOICE_DATA_FAIL = 0; public static final int CHECK_VOICE_DATA_FAIL = 0;
/**
* Indicates erroneous data when checking the installation status of the resources used by
* the text-to-speech engine with the android.intent.action.CHECK_TTS_DATA intent.
*/
public static final int CHECK_VOICE_DATA_BAD_DATA = -1; public static final int CHECK_VOICE_DATA_BAD_DATA = -1;
/**
* Indicates missing resources when checking the installation status of the resources used
* by the text-to-speech engine with the android.intent.action.CHECK_TTS_DATA intent.
*/
public static final int CHECK_VOICE_DATA_MISSING_DATA = -2; public static final int CHECK_VOICE_DATA_MISSING_DATA = -2;
public static final int CHECK_VOICE_DATA_MISSING_DATA_NO_SDCARD = -3; /**
* Indicates missing storage volume when checking the installation status of the resources
* used by the text-to-speech engine with the android.intent.action.CHECK_TTS_DATA intent.
*/
public static final int CHECK_VOICE_DATA_MISSING_VOLUME = -3;
// return codes for a TTS engine's check data activity // return codes for a TTS engine's check data activity
/**
* Extra information received with the android.intent.action.CHECK_TTS_DATA intent where
* the text-to-speech engine specifies the path to its resources.
*/
public static final String VOICE_DATA_ROOT_DIRECTORY = "dataRoot"; public static final String VOICE_DATA_ROOT_DIRECTORY = "dataRoot";
/**
* Extra information received with the android.intent.action.CHECK_TTS_DATA intent where
* the text-to-speech engine specifies the file names of its resources under the
* resource path.
*/
public static final String VOICE_DATA_FILES = "dataFiles"; public static final String VOICE_DATA_FILES = "dataFiles";
/**
* Extra information received with the android.intent.action.CHECK_TTS_DATA intent where
* the text-to-speech engine specifies the locale associated with each resource file.
*/
public static final String VOICE_DATA_FILES_INFO = "dataFilesInfo"; public static final String VOICE_DATA_FILES_INFO = "dataFilesInfo";
// keys for the parameters passed with speak commands // keys for the parameters passed with speak commands. Hidden keys are used internally
// to maintain engine state for each TextToSpeech instance.
/**
* {@hide}
*/
public static final String TTS_KEY_PARAM_RATE = "rate"; public static final String TTS_KEY_PARAM_RATE = "rate";
/**
* {@hide}
*/
public static final String TTS_KEY_PARAM_LANGUAGE = "language"; public static final String TTS_KEY_PARAM_LANGUAGE = "language";
/**
* {@hide}
*/
public static final String TTS_KEY_PARAM_COUNTRY = "country"; public static final String TTS_KEY_PARAM_COUNTRY = "country";
/**
* {@hide}
*/
public static final String TTS_KEY_PARAM_VARIANT = "variant"; public static final String TTS_KEY_PARAM_VARIANT = "variant";
/**
* Parameter key to specify the audio stream type to be used when speaking text
* or playing back a file.
*/
public static final String TTS_KEY_PARAM_STREAM = "streamType"; public static final String TTS_KEY_PARAM_STREAM = "streamType";
/**
* Parameter key to identify an utterance in the completion listener after text has been
* spoken, a file has been played back or a silence duration has elapsed.
*/
public static final String TTS_KEY_PARAM_UTTERANCE_ID = "utteranceId"; public static final String TTS_KEY_PARAM_UTTERANCE_ID = "utteranceId";
// key positions in the array of cached parameters
/**
* {@hide}
*/
protected static final int TTS_PARAM_POSITION_RATE = 0; protected static final int TTS_PARAM_POSITION_RATE = 0;
/**
* {@hide}
*/
protected static final int TTS_PARAM_POSITION_LANGUAGE = 2; protected static final int TTS_PARAM_POSITION_LANGUAGE = 2;
/**
* {@hide}
*/
protected static final int TTS_PARAM_POSITION_COUNTRY = 4; protected static final int TTS_PARAM_POSITION_COUNTRY = 4;
/**
* {@hide}
*/
protected static final int TTS_PARAM_POSITION_VARIANT = 6; protected static final int TTS_PARAM_POSITION_VARIANT = 6;
/**
* {@hide}
*/
protected static final int TTS_PARAM_POSITION_STREAM = 8; protected static final int TTS_PARAM_POSITION_STREAM = 8;
/**
* {@hide}
*/
protected static final int TTS_PARAM_POSITION_UTTERANCE_ID = 10; protected static final int TTS_PARAM_POSITION_UTTERANCE_ID = 10;
/**
* {@hide}
*/
protected static final int TTS_NB_CACHED_PARAMS = 6; protected static final int TTS_NB_CACHED_PARAMS = 6;
} }