AudioStreamer icon indicating copy to clipboard operation
AudioStreamer copied to clipboard

Progress doesn't update after a period of time (iPhone)

Open philchass opened this issue 13 years ago • 7 comments

Experiencing the issue with short (and large) MP3.

The streamer progress doesn't update after a period of time, the streamer falls in AS_STOPPING_EOF.

Try to test the iPhoneStreamingPlayer example with a small MP3 like http://www.universal-soundbank.com/mp3/sounds/17412.mp3

streamer.duration is 4.3 sec but the player stops progress at 1.7 ... while playing normally until the end !!

philchass avatar Sep 13 '11 10:09 philchass

I used the iPhone demo app and took a bunch of sounds from http://sounddogs.com/results.asp?Type=3&CategoryID=3018&SubcategoryID=1

Result: all the sounds are not correctly played. Progress stops shortly +/- randomly.

I'd like to use this class in my project but unfortunately this issue is to huge!

philchass avatar Sep 30 '11 20:09 philchass

My MP3 file duration is 12.7 sec, but progress is stop at 9.5, but sound is hearing.

pil-zz avatar Nov 08 '11 05:11 pil-zz

I get the same bug, the "progress" stops 3 seconds before the actual song ends (for some reason)...

freak4pc avatar Nov 17 '11 23:11 freak4pc

I get the same bug.. watching this.

tehillim avatar Nov 21 '11 07:11 tehillim

Same here. There seems to be a partial but incomplete fix available here: http://stackoverflow.com/questions/7952318/audiostreamer-doesnt-show-the-correct-play-time.

mikefrederick avatar Apr 10 '12 04:04 mikefrederick

CHANGE:

        if (sampleRate > 0 && ![self isFinishing])
        {
            if (state != AS_PLAYING && state != AS_PAUSED && state != AS_BUFFERING)
            {
                return lastProgress;
            }
        ...
        }

TO:

        if (sampleRate > 0 && (state == AS_STOPPING || ![self isFinishing]))
        {
            if (state != AS_PLAYING && state != AS_PAUSED && state != AS_BUFFERING && state != AS_STOPPING)
            {
                return lastProgress;
            }
         ...
        }

in progress method

azone avatar Sep 03 '12 07:09 azone

I've added the change as suggested by azone. I haven't tested thoroughly but it shouldn't cause any problems. I'll close this when I've tested more thoroughly.

mattgallagher avatar Sep 03 '12 08:09 mattgallagher