Code example for TextToSpeech

Methods: speak

0
     * add speech, don't flush the speaking queue 
     */ 
    public void addSpeech(String toSay)
    { 
        tts.speak(toSay, TextToSpeech.QUEUE_ADD, null);
    } 
 
    /** 
     * execute the current active {@link VoiceAction} again speaking 
     * extraPrompt before 
     */ 
    public void reExecute(String extraPrompt)
    { 
        if ((extraPrompt != null) && (extraPrompt.length() > 0))
        { 
            tts.speak(extraPrompt, TextToSpeech.QUEUE_FLUSH,
                    TextToSpeechUtils.makeParamsWith(EXECUTE_AFTER_SPEAK));
        } 
        else 
        { 
            execute(getActive());