Example usage for android.speech.tts TextToSpeech getFeatures

List of usage examples for android.speech.tts TextToSpeech getFeatures

Introduction

In this page you can find the example usage for android.speech.tts TextToSpeech getFeatures.

Prototype

@Deprecated
public Set<String> getFeatures(final Locale locale) 

Source Link

Document

Queries the engine for the set of features it supports for a given locale.

Usage

From source file:Main.java

/**
 * Returns whether speech synthesis using a specific language on the
 * specified TTS requires a network connection.
 *
 * @param tts The TTS engine to check./*from  www .  j a va  2 s .  c o  m*/
 * @param language The language to check.
 * @return {@code true} if the language requires a network connection.
 */
public static boolean isNetworkRequiredForSynthesis(TextToSpeech tts, Locale language) {
    final Set<String> features = tts.getFeatures(language);
    return features.contains(Engine.KEY_FEATURE_NETWORK_SYNTHESIS)
            && !features.contains(Engine.KEY_FEATURE_EMBEDDED_SYNTHESIS);
}