Sound in android (StreamingMediaPlayer not working properly. Sluttered)
<pre><code>    private void mostrarDiapositiva(Vector&lt;Diapositiva&gt; d, int pos) {
    if ( pos &gt;= d.size() ) {
        pos = d.size() - 1;
    }
    Diapositiva diapo = d.get(pos);

    this.setDiapoPosActual(pos);
    this.setDiapoActual(diapo);

    reiniciarDiapositiva();

    mostrarDiapositiva(diapo);
    try {
        if (diapo.tieneSonido()) {
            String sndPath = ZIP_SND_PATH + diapo.getSonido().getNombre();
            InputStream isSonido = this.getTutorFile().getFile(sndPath);

            this.audioPlayer = new StreamingMediaPlayer(this);
            this.audioPlayer.startStreaming(isSonido);

        }   else if (diapo.tieneVideo()) {
            if (!diapo.tieneImagen()) {
                String imgPath = ZIP_FONDOS_PATH + "fondo_video.png";
                cargarImagen(imgPath);
            }
        }
    } catch (Throwable ex) {
        Log.e("mostrarDiapositiva", ex.getMessage());

        Toast
        .makeText(this, "Error: " + ex.getMessage(), Toast.LENGTH_SHORT)
        .show();
    }


}

private void mostrarDiapositiva(Diapositiva diapo) {

    ImageButton bp = (ImageButton) findViewById(R.id.buttonprev);
    bp.setImageResource(R.drawable.ic_menu_back);

    ImageButton bn = (ImageButton) findViewById(R.id.buttonnext);
    bn.setImageResource(R.drawable.ic_menu_forward);

    try {

        if (diapo.tieneImagen()) {

            String imgPath = ZIP_IMG_PATH + diapo.getImagen().getNombre();

            cargarImagen(imgPath);
        }

        this.animarFade(this.FLIPPER_DIAPOS_NUMLAYOUT);

        //if (diapo.tieneSonido()) {
        //  String sndPath = ZIP_SND_PATH + diapo.getSonido().getNombre();
        //  InputStream isSonido = this.getTutorFile().getFile(sndPath);


    } catch (Throwable ex) {
        Log.e("mostrarDiapositiva", ex.getMessage());

        Toast
        .makeText(this, "Error: " + ex.getMessage(), Toast.LENGTH_SHORT)
        .show();
    }

}
</code></pre>

<p>and everithing works fine except the sound. When I paint the screen </p>

<blockquote>
  <p>mostrarDiapositiva(diapo);
   we have an associated sound for every slide so if it has sound (if (diapo.tieneSonido())) it´s plays it.</p>
</blockquote>

<p>the problem is that the very first time the audio starts after one or two syllable it starts again.</p>

<p>it´s seems like the audio starts when the slide is being painted and when it is painted it starts again. There  any doevents or somethink like that?</p>

<p>thanks</p>
