hi! I have this code:

    private void mostrarDiapositiva(Vector<Diapositiva> d, int pos) {
    if ( pos >= 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();
    }

}

and everithing works fine except the sound. When I paint the screen

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

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

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?

thanks

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to