Java - Slowing down the playback of an audio file without changing its pitch. UtteranceProgressListener. Summary Public Constructors public UtteranceProgressListener () Public Methods public abstract void onDone ( String utteranceId) Called when an utterance has successfully completed processing. All audio will have been played back by this point for audible output, and all output will have been written to disk for file synthesis requests. Parameters public abstract void onError ( String utteranceId) Called when an error has occurred during processing. Public abstract void onStart ( String utteranceId) TextToSpeechService. Class Overview Abstract base class for TTS engine implementations. The following methods need to be implemented.
The first three deal primarily with language management, and are used to query the engine for it's support for a given language and indicate to it that requests in a given language are imminent. onSynthesizeText(SynthesisRequest, SynthesisCallback) is central to the engine implementation. The implementation should synthesize text as per the request parameters and return synthesized data via the supplied callback.
This class and its helpers will then consume that data, which might mean queueing it for playback or writing it to a file or similar. All calls to this method will be on a single thread, which will be different from the main thread of the service. Synthesis must be synchronous which means the engine must NOT hold on the callback or call any methods on it after the method returns onStop() tells the engine that it should stop all ongoing synthesis, if any. Summary. TextToSpeech.EngineInfo. Class Overview Information about an installed text-to-speech engine. Summary Fields public String label Localized label for the engine.
Public Constructors public TextToSpeech.EngineInfo () Public Methods public String toString () Returns a string containing a concise, human-readable description of this object. GetClass (). getName () + '@' + Integer . toHexString ( hashCode ()) See Writing a useful toString method if you intend implementing your own toString method. Returns a printable representation of this object. TextToSpeech.Engine. Summary Constants public static final String ACTION_CHECK_TTS_DATA Activity Action: Starts the activity from the platform TextToSpeech engine to verify the proper installation and availability of the resource files on the system. Upon completion, the activity will return one of the following codes: CHECK_VOICE_DATA_PASS , CHECK_VOICE_DATA_FAIL , CHECK_VOICE_DATA_BAD_DATA , CHECK_VOICE_DATA_MISSING_DATA , or CHECK_VOICE_DATA_MISSING_VOLUME .
Moreover, the data received in the activity result will contain the following fields: EXTRA_VOICE_DATA_ROOT_DIRECTORY which indicates the path to the location of the resource files, EXTRA_VOICE_DATA_FILES which contains the list of all the resource files, and EXTRA_VOICE_DATA_FILES_INFO which contains, for each resource file, the description of the language covered by the file in the xxx-YYY format, where xxx is the 3-letter ISO language code, and YYY is the 3-letter ISO country code. Constant Value: "android.speech.tts.engine.CHECK_TTS_DATA" TextToSpeech. Class Overview Synthesizes speech from text for immediate playback or to create a sound file.
A TextToSpeech instance can only be used to synthesize text once it has completed its initialization. Implement the TextToSpeech.OnInitListener to be notified of the completion of the initialization. When you are done using the TextToSpeech instance, call the shutdown() method to release the native resources used by the TextToSpeech engine. Summary Constants public static final String ACTION_TTS_QUEUE_PROCESSING_COMPLETED Broadcast Action: The TextToSpeech synthesizer has completed processing of all the text in the speech queue.
Constant Value: "android.speech.tts.TTS_QUEUE_PROCESSING_COMPLETED" public static final int ERROR Denotes a generic operation failure. Constant Value: -1 (0xffffffff) public static final int LANG_AVAILABLE Denotes the language is available for the language by the locale, but not the country and variant. Constant Value: 0 (0x00000000) public static final int LANG_COUNTRY_AVAILABLE. SynthesisRequest. Speech.tts. SynthesisCallback.