Múltiples instancias de AudioStreamer si se toca demasiado rápido en la vista de tabla

I'm having issues with the AudioStreamer which is driving me crazy. I have a tableview with songs from a remote server. When I click on a song it stream fine, but if I tap too fast I get multiple instance of AudioStreamer playing different songs.

I heard that making AudioStreamer a singleton will fix this issue, but I tried that and it crashes too often. Does anybody had faced this issue and founded a solution?

Gracias.

ACTUALIZADO:

The solution to this problem was to remove this line from the -(void)stop method. Also change anything that says estado a self.state

if (state == AS_WAITING_FOR_DATA || state == AS_STARTING_FILE_THREAD)
volver;

preguntado el 01 de febrero de 12 a las 03:02

2 Respuestas

The solution to this problem was to remove this line from the -(void)stop method. Also change anything that says state to self.state

if (state == AS_WAITING_FOR_DATA || state == AS_STARTING_FILE_THREAD) return;

Respondido 11 Feb 12, 21:02

I founded the solution in another post. But just in case, here is what I did wrong.

Another post here at stackoverflow pointed to the following link. I follow the solution in that link before but not completely. I missed the most important part which was below the code.

https://github.com/mattgallagher/AudioStreamer/issues/26

"The variable pausedByInterruption is needed since we only want to resume playing after an interruption iff audio was paused by an interruption. So, the ivar pausedByInterruption needs to be set to NO in the following methods: pausa, comienzo, detener y la initWithUrl."

Let me repeated, make sure that you do this part "the ivar pausedByInterruption needs to be set to NO in the following methods: pausa, comienzo, detener y la initWithUrl."

After doing this, my issue was resolved.

Respondido 01 Feb 12, 19:02

Which post here at Stack Overflow? - Peter O.

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.