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: Change the playback duration of a file by configurable tag? (Read 680 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Change the playback duration of a file by configurable tag?

2025/03/11
Change the playback duration of a file by configurable tag?
I use Fb2k for dance parties (tango with video projection of the title, genre, duration, etc., and a slideshow); I'm not a computer scientist, forum user, or English speaker; I don't know where to post my question properly without bothering you.
I'm looking for a way to tell Fb to play certain files (all 3 files in a list) for a controlled duration of 0 to %length% minutes: either automatic (the duration = %length%), or chosen (example in my case: 30 seconds), while still allowing the manual option to extend by 1 or x minutes. This is essential for playing interludes between series of dances depending on whether people are dancing them or not (without trimming at the beginning or end, and, of course, without cutting the source files with Audacity). I have not found a way to do either a component or a tag: a tag filled with a duration in seconds that Fb would read and execute if a checked button asks it to.
Thanks for your help if you had a clue and in a language understandable to me. Gia
Gia

Re: Change the playback duration of a file by configurable tag?

Reply #1
while still allowing the manual option to extend by 1 or x minutes.
This would be the difficult bit.
It's your privilege to disagree, but that doesn't make you right and me wrong.

Re: Change the playback duration of a file by configurable tag?

Reply #2
You seem to have quite specific requirements. You could achieve the on-the-fly track length adjustment with Skip Track component, but you would not have any of the fancy features like increasing time by 1 minute with a press of a button or adjusting the length by percentage.
You simply have a tag field called SKIP where you manually enter the time when a track should end, for example if you want track length to be 1 minute 25 seconds you would tag the file as SKIP=1:25-. As long as you edit the tag before decoding reaches the old tagged ending position you can keep increasing the playback time by manually altering the tag content.

You could also check Preview, but not sure if that functionality is what you are after.

The final option is to create the functionality you want with a javascript scripting panel. Javascript is simple and the components give you easy access to run your script on playback callback that is called once a second during playback. You can run your length tag check in that callback and jump to the next track under time conditions you define.
And the scripting components also make it easy to add context menu commands so you can add the time manipulation commands you want. And if you are feeling fancy and have the skills, you can create a complete UI with buttons and sliders.

Re: Change the playback duration of a file by configurable tag?

Reply #3
You can probably automate some of your requirements with a bit of gymnastics with foo_scheduler, e.g. by creating menu actions for different durations.

A fully generalized solution however will need custom scripting using one of the Javascript-enabled components (i.e. foo_uie_webview or foo_spider_monkey_panel), in which you can go wild and even get pretty good UX (e.g. using mouse wheel to finetune the remaining time on the fly), though it is some (IMHO fun) work.

Re: Change the playback duration of a file by configurable tag?

Reply #4
Install the vgmstream decoder plugin.
For "music1.ogg", to set a duration of 30 seconds, create an empty file "music1.ogg #b 30.0 .txtp", or create a text file with content "music1.ogg #b 30.0" and rename it to (any name).txtp, then play the txtp file with foobar2000. It should work if file doesn't have loop points, which should be the most common case.
Quote
(time) can be M:S(.n) (minutes and seconds), S.n (seconds with dot), 0xN (samples in hex format) or N (samples). Beware of 10.0 (ten seconds) vs 10 (ten samples).
TXTP file format

 

Re: Change the playback duration of a file by configurable tag?

Reply #5
Thank you all four; give me a few days to translate, understand, and test your solutions (and 'fun work'), and I'll get back to you. I'm expanding my practice:
I also reduce the volume of these files by 10 to 15dB during these breaks called "cortinas". As with the duration, I'd like to automate this: start my 30-second segments at reduced volume and increase the duration + volume at the audience's request (now with my sound controller; I also use a sound meter).
NB: In a 5-hour evening (list), this problem arises 33 times. As a volunteer, I don't want to stay stuck behind my computer, so I have to adjust the duration + volume to the dancers' reactions: either the minimum of 30 seconds and reduced volume by default, or a manual extension at normal volume.
Gia