Code example for TextToSpeech

Methods: isSpeaking

        public int speak(String text, int queueMode, String jsonParams) {
            // Try to pull the params from the JSON string. 
            HashMap<String, String> params = null;
            try { 
                if (jsonParams != null) {
                    params = new HashMap<String, String>();
                    JSONObject json = new JSONObject(jsonParams);
                    // Using legacy API here. 
                    Iterator<String> keyIt = json.keys();
                    while (keyIt.hasNext()) {
                        String key =;
                        // Only add parameters that are raw data types. 
                        if (json.optJSONObject(key) == null && json.optJSONArray(key) == null) {
                            params.put(key, json.getString(key));
Connect your IDE to all the code out there  Get Codota for Java