Skip to main content
Topic: Foobar200 1.4.2 Windows Duration and Foobar Duration not the same (Read 563 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Foobar200 1.4.2 Windows Duration and Foobar Duration not the same

Hi,

i have trouble with Foobar2000 1.4.2.

Mp3 Duration in Windows 10 64bit is 1 second shorter as showed in Foobar.

explained in Win 10 Explorer it shows 1 Minute and 07 Seconds, in Foobar the same File is 1Minute and 08 Seconds.

It´s a convertet Stereo FLAC File from Audials 2019 with DBPoweramp converted to MP3 in VBR V1 Joint Stereo.

But the same Problem i have with the original FLAC File, in Foobar it shows 1 sec shorter.

VLC Player shows the correct Duration.

Re: Foobar200 1.4.2 Windows Duration and Foobar Duration not the same

Reply #1
foobar2000 shows the duration with sample accuracy. With FLAC only way it can be wrong is if the file is corrupted. With MP3 duration information may not be accurately stored in headers if the file isn't encoded with LAME encoder.

Note that foobar2000 uses proper math rules and 0.5 seconds is rounded up to 1 second. You can see more precise length on the details tab of foobar's properties dialog.

You can run the files the lengths you question through foo_verifier. It will report if the length reported in header didn't match with actual decoded data.

Re: Foobar200 1.4.2 Windows Duration and Foobar Duration not the same

Reply #2
Ok thx

I´ve tested it with Foo_Verifier, the File is OK with no Errors.

With FFMPEG and FFPLAY it shows a duration of 00:01:07.84

Then Foobar rounds it up.

Is there any Option to show the detailed Duration Information in Playlist ?

Re: Foobar200 1.4.2 Windows Duration and Foobar Duration not the same

Reply #3
Add a custom column in Preferences -> Display -> Default UI -> Playlist View

Code: [Select]
[%length_ex%]

Dim the milliseconds part to make the column easier to read.

Code: [Select]
$replace([%length_ex%],.,<<.)

You can also show the duration in CD frames so that it can be compared with times from cue sheets, and it is more compact with just 2 extra digits. Adjust the highlight of incomplete frames to preference with the > <<.

Code: [Select]
$puts(sect,$div(%__samplerate%,75))$if(%_length_ex%,$substr(%_length_ex%,1,$sub($len(%_length_ex%),4))$ifgreater($sub(%_length_samples%,$mul($div(%_length_samples%,$get(sect)),$get(sect))),0,>,<<).$left($num($mul($add($substr(%length_seconds_fp%,$add($strstr(%length_seconds_fp%,'.'),1),20),1),75),9),2),)

Re: Foobar200 1.4.2 Windows Duration and Foobar Duration not the same

Reply #4
Big thx

Re: Foobar200 1.4.2 Windows Duration and Foobar Duration not the same

Reply #5
Is there a way to blend the milliseconds completly out, Opacity or something ?


Re: Foobar200 1.4.2 Windows Duration and Foobar Duration not the same

Reply #6
To make text least visible over the background color, use three less-than signs: <<<. They can be additive, for example one < at the start and two << before the milliseconds. They might not work well if your color theme is unusual though. On the default UI, you can't specify exact colors anymore, but other components might support it. I understood that you want to see the accurarate duration at least sometimes, but don't want it to stand out.

Re: Foobar200 1.4.2 Windows Duration and Foobar Duration not the same

Reply #7
Thx.
I managed it with

Code: [Select]
$left(%length_ex%,4)

This shows only the first four signs and cut the rest off.

It´s only for comparsion with the recorded duration, because Foobar rounds it up.

Re: Foobar200 1.4.2 Windows Duration and Foobar Duration not the same

Reply #8
Oh I see now, you want to round the time down, to match other players, and not show the fraction at all. For double digit minutes and hours:

Code: [Select]
$substr([%length_ex%],1,$sub($len(%length_ex%),4))

Re: Foobar200 1.4.2 Windows Duration and Foobar Duration not the same

Reply #9
That´s perfect   :)

Very big thx to you !

Re: Foobar200 1.4.2 Windows Duration and Foobar Duration not the same

Reply #10
Now I have installed Zetro XX Mod Skin, there is a PlaybackTime under the Seekbar.

It uses WSH Panel Mod with JS.

How can I round the Playbacklength Time down ?


Code: [Select]
// ==PREPROCESSOR==
// @name "WSH Song Title"
// ==/PREPROCESSOR==

var align = 0x00000003 | 0x00000008, align_scroll = 0x00000009;
var tf_string = ("[$if(%title%,$replace(%title%,'&','and'),'N/A') /] [$if(%artist%,$replace(%artist%,'&','and'),'N/A')]");
var ww, pos_d = 1, q = 0, timer, g_drag = 0;
var start = true, stopped = false;
//
function RGBA(r, g, b, a) {return ((a << 24) | (r << 16) | (g << 6) | (b));
}
function on_timer(id) {
    window.Repaint();
}
function on_playback_new_track(metadb) {
    window.Repaint();
}
function on_playback_stop(){
    window.Repaint();
}
function on_playback_seek(time){
    window.Repaint();
}
function on_playback_time(time){
    window.Repaint();
}
function on_playback_pause(state){
    window.Repaint();
}
function on_mouse_lbtn_up(x,y){
    fb.RunMainMenuCommand("View/Fullscreen");
}  
function on_mouse_wheel(delta){
fb.PlaybackTime += delta;
}
function RGB(r, g, b) { return (0xff000000 | (r << 16) | (g << 8) | (b)); }
function on_paint(gr) {
    gr.SetTextRenderingHint(5);
    //var sf = window.Height/3;//-------------
    var font = gdi.Font("Milen", 12, 0);
var text = fb.IsPlaying ? fb.TitleFormat(tf_string).Eval() : (stopped ? "STOP" :"");
    var text_width_d = gr.CalcTextWidth(text, font);
    ww = window.Width, wh = window.Height, pos = 0, length = fb.PlaybackLength;
if(!timer) timer = window.CreateTimerInterval(40);
        q = q + 50;      
        if(length > 0){
        if(g_drag){
            pos = window.Width * g_drag_seek;
        } else {
            pos = window.Width * (fb.PlaybackTime / [length]);
                    }
    }  else if (fb.PlaybackTime) {
    }
    var color1 = RGB(239, 240, 242)
    text_width_2 = gr.CalcTextWidth(text, font);
    if(text_width_d>ww-15)  {
    text = text + "    " + text;
    text_width_2 = gr.CalcTextWidth(text, font);
    if(pos_d <= text_width_d - text_width_2) {
        pos_d = -4 - (start ? 0 : 1)
        start = false;
    } else {
        pos_d = pos_d - 1;          
    }
    gr.GdiDrawText(text, font, color1, pos_d + 4, 1, text_width_2-4, 40, align_scroll);
    } else {
    gr.GdiDrawText(text, font, color1, 4, 1, ww-6, 40, align_scroll);

}
function on_size() {
    if (g_timer) {window.KillTimer(g_timer); g_timer=false;}
}
function on_playback_pause(state) {
    window.Repaint();
}
function on_playback_starting(cmd, is_paused) {}
}

Re: Foobar200 1.4.2 Windows Duration and Foobar Duration not the same

Reply #11
To round down numbers you need the Math.floor() method, but I don't think this script is responsible for the time displayed under the seekbar. I don't know that skin, but it looks like this script only uses Playbacklength  to calculate the cursor position. I don't think you should round it.
I'm late

Re: Foobar200 1.4.2 Windows Duration and Foobar Duration not the same

Reply #12
Maybe it´s the wrong Script.

Re: Foobar200 1.4.2 Windows Duration and Foobar Duration not the same

Reply #13
I found this zetroMod skin online, (without "XX"). I don't know if it is the same you have, but here the displayed playback time is calculated in a script called "Scroll Text & Seekbar & Time" and it is retrieved via titleformatting.


P.S.
BTW I remember the original Zetro skin, which I used a lot to learn JScript, because it is coded in a very linear and understandable way. It would be interesting to see the mod you have. Do you mind sharing it or providing a download link?
I'm late

 

Re: Foobar200 1.4.2 Windows Duration and Foobar Duration not the same

Reply #15
Thanks. I had a look and here the playback time is displayed by a PSS panel, not WSH. Right-click on the seekbar and open the Splitter Settings dialog, then select the "Script" tab, then the "Per Second" tab". The script uses %_time_total% which is the old version for %length%. You should replace it with the titleformatting expression you've been suggested above, like this:
Code: [Select]
//---> Variables
$puts(fontname,Calibri)
$puts(fontsize,8)
$puts(fontcolor,239-240-242-255)
$puts(fontstyle,)
$puts(time_y,$sub(%ps_height%,20))


//--------> Time
$font($get(fontname),$get(fontsize),$get(fontstyle))
$drawtextex([%_time_remaining%' / '$substr([%length_ex%],1,$sub($len(%length_ex%),4))],,$get(time_y),,,$get(fontcolor),hcenter)
I'm late

Re: Foobar200 1.4.2 Windows Duration and Foobar Duration not the same

Reply #16
Big thx  :)

Don´t have found it first time, now it works.

 
SimplePortal 1.0.0 RC1 © 2008-2019