mIRC Homepage
Posted By: NRJ Troubles with $sound().length - 10/05/04 03:20 PM
I think, there is a little bug in this identifier or I script is bad.

When I want to see a Tracks Length from a MP3-File, the length is ever too long.

Real File Length: 04:04

//echo -s $time($calc($sound($findfile(D:\Energy\Currents\,*,1)).length / 1000),nn:ss)


mIRC Echo: 05:06 !

The file length is even to long. When I put in a short MP3-File, it works. Is it a bug??


Mathias
Posted By: tidy_trax Re: Troubles with $sound().length - 10/05/04 03:55 PM
try changing $time to $asctime
Posted By: Wolfie Re: Troubles with $sound().length - 10/05/04 05:02 PM
Building on what tidy_trax told you...
Code:
//echo -s $asctime($calc($timezone + $sound($findfile(D:\Energy\Currents\,*,1)).length / 1000),h:nn:ss)

Then if you happen upon an MP3 that is over an hour, it'll report it accurately.
grin
Posted By: NRJ Re: Troubles with $sound().length - 10/05/04 05:46 PM
It doesn't work frown


* /echo: insufficient parameters
Posted By: Wolfie Re: Troubles with $sound().length - 10/05/04 06:04 PM
Code:
//echo -s $asctime($calc($timezone + $sound($sfile(*.mp3,MP3)).length / 1000),H:nn:ss)

Try that. It'll prompt you to select an mp3 file.
Just copy/paste that entire line. (I tested it myself)
cool
Posted By: Iori Re: Troubles with $sound().length - 10/05/04 10:09 PM
Code:
alias mp3dur tokenize 46 $calc($1 /1000) | return $gmt($1,$iif($1 > 3599,H:) $+ nn:ss)

//echo -a $mp3dur($sound($findfile(D:\Energy\Currents\,*.mp3,1)).length)
//echo -a $mp3dur($insong.length)
Posted By: NRJ Re: Troubles with $sound().length - 11/05/04 04:38 PM
a)

//echo -s $asctime($calc($timezone + $sound($sfile(*.mp3,MP3)).length / 1000),H:nn:ss)

does not work (any mp3 file not work with it):

* /echo: insufficient parameters


b)

alias mp3dur tokenize 46 $calc($1 /1000) | return $gmt($1,$iif($1 > 3599,H:) $+ nn:ss)

--------------------------------------------------------------------------------

//echo -a $mp3dur($sound($findfile(D:\Energy\Currents\,*.mp3,1)).length)
//echo -a $mp3dur($insong.length)


--> Not working, too! frown(
Here I can see the wrong file length again.


Mathias
Posted By: Wolfie Re: Troubles with $sound().length - 12/05/04 07:59 AM
Then, no offense, you are doing something wrong.

Both of those methods work. The one that I pasted I know works, I tested it.

And as for Iori's method, that works too.
Posted By: NRJ Re: Troubles with $sound().length - 12/05/04 04:07 PM
Sorry...

* /echo: insufficient parameters


:-(
Posted By: Wolfie Re: Troubles with $sound().length - 12/05/04 05:19 PM
1. Verify that the file you are trying to use actually does exist.
2. Copy and paste EXACTLY what you are doing

Because if it's working for others but not for you, then it's something you are doing.
Posted By: NRJ Re: Troubles with $sound().length - 13/05/04 05:04 PM
Ok, two attempts:

1. I want to know the title length from my MP3-File: 3 Doors Down - Be Like That.mp3

Real title length (Explorer & All MP3-Players): 04:25

Then I type into mIRC (newest version, already):

//echo -s $asctime($calc($timezone + $sound($sfile(*.mp3,MP3)).length / 1000),H:nn:ss)

Now I select these MP3 and click "Open":

* /echo: insufficient parameters
-



2. Kosheen - Catch.mp3 (03:21)

The same as on top and...:

* /echo: insufficient parameters
-





And now?????????


Mathias
Posted By: Wolfie Re: Troubles with $sound().length - 14/05/04 07:36 PM
Are they on a local drive or on a network resource (ie, on another computer)?
Posted By: Iori Re: Troubles with $sound().length - 15/05/04 12:29 AM
Well, I don't know whats up with your mp3s then that $sound().length and $insong.length is seemingly returning the wrong values. That code works fine (±1s) for me and others.
Posted By: Iori Re: Troubles with $sound().length - 15/05/04 12:34 AM
Wolfie, this is why your snip doesn't work for everyone.
//echo -s $!asctime( $calc($timezone + $sound($sfile($mp3dir*.mp3,MP3)).length / 1000) ,H:nn:ss)
$asctime( [color:red]-35774.797 ,H:nn:ss)[/color]
Your timezone must be GMT or GMT-(N) for that to work. Here, $timezone == -36000 (GMT+10)
Posted By: Wolfie Re: Troubles with $sound().length - 15/05/04 03:02 AM
I would think that it should still return something, even if it's a wrong value.

And I'm in the EST (GMT-5 normally, GMT-4 during DST), and the $timezone was supposed to correct for the value difference from midnight. Odd though.
Posted By: NRJ Re: Troubles with $sound().length - 15/05/04 03:22 PM
Iori, here are the echoes of your command line:

1. $asctime( -3293.509 ,H:nn:ss)
(It's Alanis Morissette - Everything = 04:04 real file length)


All my mp3's on a local drive. They are in a good quality, have no errors, the drive is new and I have no problems with my Windows & mIRC.

What is wrong? The script? mIRC? (Bug?) Or what?


Mathias
© mIRC Discussion Forums