Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Any way to retain the duration played as you switch to another track? (Read 1295 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Any way to retain the duration played as you switch to another track?

Hello!

I'm not sure how niche of a request this is, but I haven't been able to find a topic like this yet, so I opened my own.

Is there a way to keep the duration played of a song as you manually switch to another one? Say I had listened to a minute of Song A, and manually switched to Song B, would it be possible to switch immediately to after a minute in Song B (preferably with the transition fading that comes in Preferences > Playback _> Output -- Fading)?

Again, I'm not sure how niche this is. I've got two songs that are both the exact same duration length and complement each other (but are distinct in instrument composition), and it would be lovely to be able to switch between them at whichever length of time.

Thank you! :D

Re: Any way to retain the duration played as you switch to another track?

Reply #1
If you only want to do that seldomly, you could use the built-in ABX component for that. It's meant for doing double blind listening tests, but it allows switching seamlessly between two tracks.

Re: Any way to retain the duration played as you switch to another track?

Reply #2
If you only want to do that seldomly, you could use the built-in ABX component for that. It's meant for doing double-blind listening tests, but it allows switching seamlessly between two tracks.
Thank you for this!!
This works very well, and contains the functionality I require, but falls short in its execution (at least, for my purpose, I'm sure it's perfect for those who need it for actual testing). Sorry for not being as clear in my topic post :')

It provides good seamless transitioning and with Replaygain (and training mode), provides an apt experience. I failed to mention that this functionality was intended for casual use, however, and the "seldom" nature of the test player that the ABX comparator provides is unable to do so (only plays once, can't be switched with the ⏮️/⏭️ (fn enabled) keys, etc), to my knowledge. My bad.

Anything similar to the comparator but able to be used in a casual format, say, latched onto the Foobar2000 music player?

Thanks in advance, :D

(should also mention that I couldn't find the "built-in" ABX comparator initially, instead installing it from under the Components tab on the Foobar2000 website by Peter.)

Re: Any way to retain the duration played as you switch to another track?

Reply #3
Here's a highly experimental component that may achieve what you wish: https://foobar.hyv.fi/foo_retain_playtime.fb2k-component.

Enable by adding 'Retain Playtime' DSP to the active DSP chain. Abuses decoder shim tech that Peter added for my Skip Track component.

Re: Any way to retain the duration played as you switch to another track?

Reply #4
Here's a highly experimental component that may achieve what you wish: https://foobar.hyv.fi/foo_retain_playtime.fb2k-component.

Enable by adding 'Retain Playtime' DSP to the active DSP chain. Abuses decoder shim tech that Peter added for my Skip Track component.
Again, many thanks!! Works great. :)

I've found that the transitioning from one track to another, whether intentional or not, adds about a 2-second forward offset to the next track's retained duration (so it's just a little off), and changing the fading duration in manual track changing doesn't necessarily mitigate it. I tried finding the source code for the component online to try my hand at fixing it (if even possible :'D) but to no avail. I'm not really sure where you got this experimental component from, but (aside from the 2-second offset) it works wonders! 1000% better than not having the functionality in the first place.

My gratuity to you, fellow interweb user! :D

Re: Any way to retain the duration played as you switch to another track?

Reply #5
I got the component by just coding it for you. It keeps track of internal decoder time at the moment, which of course can be way ahead of what is heard if output buffer is long. I can improve it now if this is what you're after.

Re: Any way to retain the duration played as you switch to another track?

Reply #6
I got the component by just coding it for you. It keeps track of internal decoder time at the moment, which of course can be way ahead of what is heard if the output buffer is long. I can improve it now if this is what you're after.

Oh, I see! So is "highly experimental" just programmer slang for "I made it moments ago"? XD

Thank you so much!! You were under no obligation to, and yet you made one anyway!! I am sincerely grateful, perhaps neat pieces of software really do have neat people like you follow suit :)

Don't feel any pressure to, the DSP works great currently. If it's too much a hassle then I don't mind at all, it's already amazing enough that you did this in the first place!!

Compounding on what you said earlier about its reliance on the internal decoder, my current output buffer length was manually set to about 1030ms~ to accommodate for the fading event times I set earlier, but I saw it at about 2000ms later, not sure if I just set it that way without realising or if it's variable depending on what needs it.

If it's of no circumstance to you, then please, go ahead! The installed component already works many wonders, and the inherent offset isn't too much of an issue in casual listening, Can't thank you enough already XD

My (deepened) gratuity to you, fellow Foobar2000 expert!! :)

Re: Any way to retain the duration played as you switch to another track?

Reply #7
I made some small improvements, download from the same link. It will now reset the time if playback is stopped and it now asks for the playback time from the core and not the decoder, so it should no longer skip ahead.

Re: Any way to retain the duration played as you switch to another track?

Reply #8
I made some small improvements, download from the same link. It will now reset the time if playback is stopped and it now asks for the playback time from the core and not the decoder, so it should no longer skip ahead.
Yep, after replacing the earlier one, it's near perfect for what I need! There exists the teeniest, tiniest buffer (it's so small I literally can't tell if it's forward or backwards) that I didn't catch the first few times using, only realising it when I tried focusing really hard on the transition and tweaking the fade in/out lengths for the manual track change. I have literally no qualms about it, it's practically invisible when listening casually, really don't bother trying to fix it.

An actual issue I noticed, however, is that (right as one of the songs ends) it tends to loop back only a bit, replaying the same part at the end over and over, then finally looping back to the beginning (Order: Repeat Track). I have no idea what's causing it, but after tweaking around a bit, I found that it seems to go back the exact same length of the Output Buffer (If I have a 2-minute song and a 10000ms Output Buffer, it goes back to 1:50~). It seems to be happening sporadically, sometimes not happening, sometimes happening once, sometimes happening more than once (in this case, the first repeat goes back about the same length as the output buffer, but then the next loopback is shorter? This behaviour is also sporadic, sometimes not occuring).

I didn't find this issue with the earlier iteration of the component, so perhaps it has something to do with the retrieving process (I have no clue XD). It's causing quite a big hamper in listening, so I've disabled it for now. Stupid me decided to replace the earlier DLL file with the new iteration, and it didn't save the previous version, so until it's fixed (or you allow downloading of the previous version yet again) I'll be out of it for now.

Again, thanks in advance! (And of course, thank you for dedicating your time to this XD)

Re: Any way to retain the duration played as you switch to another track?

Reply #9
Sorry about the bug, I didn't take same track repeating into account at all. First version didn't need any special handling for any situation as its logic was super simple.

New version uploaded that outsources time tracking to a separate thread, track switch time should now be accurate to 10 milliseconds, assuming all components report latency correctly.
The component will now detect if it's the same track we are playing and won't seek to the last recorded timestamp, fixes for example the repeat track playmode.
And if timestamp is beyond current track's duration the component will start the track from the beginning. Previous versions seeked past the end skipping the track entirely.

Re: Any way to retain the duration played as you switch to another track?

Reply #10
Sorry about the bug, I didn't take the same track repeating into account at all. The first version didn't need any special handling for any situation as its logic was super simple.

New version has been uploaded that outsources time tracking to a separate thread, track switch time should now be accurate to 10 milliseconds, assuming all components report latency correctly.
The component will now detect if it's the same track we are playing and won't seek to the last recorded timestamp, fixes for example the repeat track play mode.
If the timestamp is beyond the current track's duration the component will start the track from the beginning. Previous versions seeked past the end skipping the track entirely.
No sweat, continual use has seen no errors so far, you've done it mate!!

Again (not sure how many times now XD), thank you so damn much for this! Exam season has me beat sometimes and the music loop I've got (can't really focus with anything other than repetitive music static playing) gets me tired, so a small shift into a more bellicose variant of the same song revitalises me, and this small but oh so good transition just makes the experience so much better (I tend to manual track switch between the two songs quite a bit in an hour)!

God's work mate, I've got a 1-second manual track change fade that suits it so damn well, I literally can't tell that there's a delay XD. You're an absolute beast!!!!

But that's enough of me yammering, it's been an absolute pleasure talking with you!! My (maximised) gratuity to you, fellow Foobar2000 connoisseur!! :DD

..not exactly sure how to mark a forum for closure or something of the stature "Solved!". I'll just sign off here, thanks!

Re: Any way to retain the duration played as you switch to another track?

Reply #11
Happy to hear you approve! I think others may enjoy the component too so I published it on my page: https://foobar.hyv.fi/?view=foo_retain_playtime.