How do I get an animation to play at the same time as a TextToSpeech utterance in Android
<p>I have a set of buttons in my ChordActivity application in a LinearLayout. When a button is clicked, I want the TextToSpeech engine to speak the name of the button clicked ( e.g; Minor 7th ), which is working fine. I also want an animation of the button 'popping out then back' to occur, which I also have working. The problem is that no matter how I arrange the code, the speech happens first, then the animation happens afterward. I want them to happen at the same time. I know that TextToSpeech has its own message queue, so I assumed that if I used a runnable to do the animation, I could get the speech and the animation to happen simultaneously, but it doesn't. I then backed out the runnable and now have the following code. Does anyone have a solution for this? Much Appreciated.</p>

<pre><code>private void speakChordMessage(View v) {
        image = (ImageView) v;
        image.startAnimation(animScale);
        chordTTS.playSilence(2000, TextToSpeech.QUEUE_FLUSH, null);
        chordTTS.speak(str1, TextToSpeech.QUEUE_FLUSH, null);
        while (chordTTS.isSpeaking()) {
        }
    }
</code></pre>

<p>animscale.xml code:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;set xmlns:android="http://schemas.android.com/apk/res/android"
    android:interpolator="@android:anim/accelerate_decelerate_interpolator" &gt;
    &lt;scale
        android:duration="200"
        android:fromXScale="1.0"
        android:fromYScale="1.0"
        android:pivotX="100%"
        android:pivotY="0%"
        android:repeatCount="1"
        android:repeatMode="reverse"
        android:startOffset="0"
        android:toXScale="1.3"
        android:toYScale="1.25" /&gt;
&lt;/set&gt;
</code></pre>
