Page 1 of 1

TCMP: *.ogg files always played in track loop mode

Posted: 2017-08-29, 00:10 UTC
by DrShark
On my device with Android 4.3.1 and TC4A 2.81 beta 8, TC Media Player plays *.ogg files (preinstalled on device) in track loop mode even if other tracks are present in playlist. It's interestion that it doesn't happen with *.oga files (downloaded from internet) even after renaming to *.ogg.

Posted: 2017-08-31, 08:20 UTC
by ghisler(Author)
Sorry, I don't understand what you mean. Do you mean that the other tracks are skipped? Maybe the player cannot play them?

Posted: 2017-09-04, 09:42 UTC
by DrShark
Yes, the player plays just the ogg track in a loop, even if other tracks are exist below in the playlist.
The sample of such ogg file (together with a sample of xspf playlist for other TC4A bugreport) went today to support email.

Posted: 2017-09-04, 12:51 UTC
by ghisler(Author)
Got it, thanks - I will test it.

Re: TCMP: *.ogg files always played in track loop mode

Posted: 2021-03-03, 20:13 UTC
by DrShark
I forgot to post here the reason of an issue:
Christian Ghisler by email wrote:This .ogg file is a ring tone - it has the ANDROID_LOOP flag set in the metadata. You can see it by opening the file with F3 in Lister (on Windows), switch to binary or text mode, and searching for ANDROID_LOOP. It will find:
ANDROID_LOOP=true

Apparently it's not possible to override this flag in the MediaPlayer control:
https://stackoverflow.com/questions/12834727/android-loop-true-how-to-avoid-mediaplayer-looping-audios-with-this-metada

Re: TCMP: *.ogg files always played in track loop mode

Posted: 2021-03-05, 14:25 UTC
by ghisler(Author)
Ah, I see, thanks for the info - that's really unfortunate then...

Re: TCMP: *.ogg files always played in track loop mode

Posted: 2021-03-09, 12:48 UTC
by DrShark
Could it be possible 'to work around this MediaPlayer control behavior by stopping the playback after the whole length of such an .ogg track with ANDROID_LOOP is played? An then to autostart the playback from the file in queue which is next after .ogg with ANDROID_LOOP. Yes, this way playback won't be "gapless", but maybe at least there won't be an undesired single file loop...

Re: TCMP: *.ogg files always played in track loop mode

Posted: 2021-03-09, 13:53 UTC
by ghisler(Author)
I would have to check that in the debugger. What was the name of the sample file you sent me in post 3? Or the name of the archive in which it was?

Re: TCMP: *.ogg files always played in track loop mode

Posted: 2021-03-09, 14:11 UTC
by DrShark
2ghisler(Author)
The attach name was "tc4a_bugfiles.zip", and the .ogg file name was "01.ogg".
For convenience, I just forwarded attach from that email from 2017 to your gmail address.

Re: TCMP: *.ogg files always played in track loop mode

Posted: 2021-03-09, 15:29 UTC
by ghisler(Author)
Got it, thanks! Unfortunately I don't receive any kind of notification when the file loops. And my progress bar only works while the player is in the foreground, and checks the playback position manually every second. This wouldn't help to detect a 2 second loop.

Re: TCMP: *.ogg files always played in track loop mode

Posted: 2021-03-11, 15:09 UTC
by DrShark
ghisler(Author) wrote: 2021-03-09, 15:29 UTCUnfortunately I don't receive any kind of notification when the file loops. And my progress bar [...] checks the playback position manually every second. This wouldn't help to detect a 2 second loop.
Does such a notification from Android needed for this? The player knows that playback is started, and it knows the track length, so if actual playback time of the track goes beyond its length, we can assume it's a loop andthen to switch to a next queue track (since this ANDROID_LOOP tag only seems to be present in *.ogg files, such an assumption can be limited only for *.ogg to avoid rare buggy cases when the file length (and so, actual playback of a track) is longer than reported by player). I think, it shouldn't be a problem even for 2- and 1-senonds etc. short tracks.
ghisler(Author) wrote: 2021-03-09, 15:29 UTCmy progress bar only works while the player is in the foreground
Does this mean the player doesn't know the length of the track when its playback starts in background?

Re: TCMP: *.ogg files always played in track loop mode

Posted: 2021-03-11, 15:51 UTC
by ghisler(Author)
The player knows that playback is started, and it knows the track length, so if actual playback time of the track goes beyond its length
It's not so simple - the user can also make the playback faster/slower, or pause it.
Does this mean the player doesn't know the length of the track when its playback starts in background?
No, it can be determined also in background. But TC doesn't monitor the track progress while in background, it just reacts to the notification that the track is done to play the next track.