Jump to content
Sign in to follow this  
Madza91

_SoundLength() Bugged or not?!

Recommended Posts

Madza91

Hello, i don't know where to tell this, _SoundLength() is bugged, but only for some songs, usually with this func i get bigger sound lenght then real...

Do someone know where is error?

If is needed i will upload some mp3 songs where _SoundLength() not giving true informations...


[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Share this post


Link to post
Share on other sites
Madza91

Now i know, thank you for information :mellow:


[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Share this post


Link to post
Share on other sites
Madza91

Hi again, I tried it out and I must to say: In that Sound.au3 Beta is _SoundLength ok, BUT sometimes i get some unbelievable Sound length like 3999999:00... what's wrong with that Sound.au3? Do maybe someone have same problem with it?! :S


[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Share this post


Link to post
Share on other sites
dbzfanatic

Well make sure you're using the proper scan type. They made it variable so if you get inaccurate times on a certain song try a different method.

Share this post


Link to post
Share on other sites
Madza91

I use it on same way like old Sound.au3...


[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Share this post


Link to post
Share on other sites
dbzfanatic
Melba23

Hi,

Sorry you are having problems. RazerM and I did try to produce something reasonably bulletproof, but there is always room for improvement.

We did find a small bug in an earlier post of the Beta:

Line 503: $iLengthMs = Number($sTemp) should read $iLengthMs = Number(_HexToString($sTemp)). Otherwise it is directly converting the ASCII codes into decimal, which gives a rather larger number than the one we are looking for - i.e.: 89897:35:30 in place of 00:04:21!!!

Can you check that you have the corrected version, because that sounds a lot like the problem you are having.

If you do have the correct version, can you confirm that you having problems with MP3 files? The UDF tries to use the Windows file properties to read the length and, if this fails and the file is an MP3, reads the ID3 tag, if it exists. I only use MP3, so I only did the research to code for that file type. If you are using another type of file, there is limited scope to help.

What version of Windows are you using? Getting the length from File Properties seems only to work on later versions, so if you are on an earlier version you are heading into ID tag reading, which is less than precise and depends a lot on the encoder and its settings.

Which encoder are you using, and are you using Constant or Variable Bit Rate? If the File Properties method fails, the UDF tries a number of tactics. If the file is VBR it looks for a Xing header, or it tries to find the TLEN information within the ID3v2 tag. In my collection of over 5000 MP3s, only about 1500 have TLEN set in the tag, and I have always used the same encoder on the same settings. We also only look for ID3v2 tags at the front of the file. So encoder and tag type are important.

If you could you upload a file that is giving a strange reading, I will look into it.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
BrettF
Madza91

I updated Sound.au3 Beta, and it's still same thing... But now not giving Sound Length 3999.... now giving 0:00... and I can't set Seek...

And yes, it's mp3 file...

Here is My little Music Player with your Sound.au3 Beta and Song to see bug in Func SoundLength()...

Download not available ^^

Edit:

I will be constrained to use Bass.au3 UDF, with it I can't found bugs :mellow:

Edited by n3nE

[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Share this post


Link to post
Share on other sites
Melba23

n3nE,

Thanks for the download. I have tested the MP3 file with my various MP3 research scripts and it is a standard Constant bit rate 128 kbps file. Of the various ways _SoundLength tries to read the length, I get a time of 3:36 from the File Properties method and the MCI call. As it is a CBR file, the Xing method does not apply and the ID3 TLEN field is not filled (big surprise, not). Of interest, I went into the file header structure and calculated the same length from the bit rate and the number of frames.

On my own MP3 player and on the player you attached (which has some nice touches I might steal if you permit!) I find the same length and the file plays perfectly. I can seek backwards and forwards without any problems on both players.

The only thing that is non-standard is the ID3 tag, which is pretty corrupt. It has lots of data in it, but very little is of any use.

So, I can only assume it is something on your machine that is causing the problem. If you want to pursue this; what OS version are you running, what encoder do you use, and what version of AutoIt?

If you are happy with the Brett's BASS UDF, please enjoy it! I am happy to wait for the next problem!

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Madza91

I have Win Xp Sp2, Autoit Version: 3.2.12.1 - newest, Beta - I don't have...

I will probably use Bass UDF, because support more file types then Sound.au3...

But i want to find out why is this bugged for me, but for you not ;/

Edit:

(which has some nice touches I might steal if you permit!)

What part you want to steal, tell me and i will maybe permit you to use in your player :mellow:

Edited by n3nE

[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Share this post


Link to post
Share on other sites
Melba23

n3nE,

Ok, we have the same AutoIt and Sound UDF has been tested on XP and it worked OK. What encoder have you been using? As I mentioned, the ID3 tag is pretty corrupt. The only information in there is the URL 'www.planetamuzike.com' with null bytes in every other position - and this is in the performer, album, trackname, BPM and a few other fields!

Please look in Explorer file properties for the MP3 file on your system and see if the details section gives the correct time. This is the first thing _SoundLength looks at and if you have a wrong value there...

M23

P.S. Don't apologise for your English; my Serbo_Croat is almost non-existent! Do videnja!


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Madza91

Oh, when I removed that from ID3 it works normal -.-

Why :S

P.S. Kae se: Do vidjenja... or Do viđenja.. đ = dj :mellow:


[quote name='dbzfanatic' post='609696' date='Nov 26 2008, 08:46 AM']This is a help forum not a "write this for me" forum.[/quote](Sorry for bad English) :)

Share this post


Link to post
Share on other sites
Melba23

n3nE,

The mysteries of ID3 tags are far beyond me. I know how to read them and what the various fields are, but why some encoders produce certain fields and others do not is something of a mystery. As I said earlier, I have only 1500 of 5000+ MP3s with TLEN correctly entered, although I have always used the same encoder to rip them.

All I know is that corrupt tags are the most common reason for MP3 files not playing correctly and fixing them nearly always works.

Anyway, I hope BASS works well for you. I must get around to looking into it one day.

I'll get back about the player coding when I have looked at it more closely!

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×