TechCoder Posted February 23, 2014 Share Posted February 23, 2014 After years of wanting a replacement for 'Media Player' as a background player (and suffering the last time with it picking the same 'random' songs over and over...) - I decided to make something in AutoIt as a 'relaxing' project. Within about an hour I had a nice working start and was playing music, thanks to _SoundPlay, FileOperations.au3 and gui tools. I now play truly random songs from my folder and NEVER repeat until the list has been gone through completely (should have done this LONG ago!) However, I'm getting the occasional song that comes up with no sound. I've checked the file, works fine in MP as well as re-running it in my program (as the only selected song). Code is simple - needs a lot of work to be 'releasable' (including some code to reload the files and/or {more likely} a database... - hey, it is 0.0.0.1!), but it suits my purpose well, for now (I've got about 300 hours of songs, so a bit of time before worrying about that). But, these 'silent' songs are driving me crazy! Any ideas welcome! water 1 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 23, 2014 Moderators Share Posted February 23, 2014 TechCoder,This has been reported now and again - the main culprit seems to be corrupted ID3 tags in the files, in particular any album art. I suggest you strip all tags from the "silent" files and retag them - that has always worked for me. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
TechCoder Posted February 23, 2014 Author Share Posted February 23, 2014 I'll look at that. I'm not using the ID3 for anything (unless _SoundPlayer looks at them, etc), so never considered that. Haven't had any 'silent' ones in awhile (and didn't write down the culprits earlier as I thought it was my code...), so I will be sure to check on the next one. Thanks for the tip. Link to comment Share on other sites More sharing options...
TechCoder Posted February 23, 2014 Author Share Posted February 23, 2014 Just had another one. 1. Copied the file to a temp folder 2. Stopped the player (still going in SciTE as I am looking for ConsoleWrite stuff to try catching this - sadly, nothing interesting...) 3. Restarted the player in SciTE (so exact code) 4. Selected the temp folder (which then loaded only the one file) Played correctly. Because of that, I feel like an ID3 change is really not going to help on this one. I didn't do anything to the file other than copy/paste to the other location. Other thoughts? Any way I can put some tracking in to figure it out? I would rather it be BROKEN and/or at least duplicatable - I hate intermittent problems! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 23, 2014 Moderators Share Posted February 23, 2014 TechCoder,I can see nothing in the code you posted that would cause such a problem. Although I wonder why you brute force the song end - why not use _SoundStatus to let the file tell you it is ended rather then just waiting for a fixed time? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
TechCoder Posted February 23, 2014 Author Share Posted February 23, 2014 just learning the UDF (as well as AutoIt), so 'brute force' is sometimes the only way I know how to do things - learning more as I go, in fact, I just put in If _SoundPos($aSound, 2) >= _SoundLength($aSound, 2) Then as I found that in the help file. I'll go look into _SoundStatus Link to comment Share on other sites More sharing options...
TechCoder Posted February 24, 2014 Author Share Posted February 24, 2014 Not fully tested yet, but I think the 'silent' songs are gone! I put in a label to constantly show _SoundStatus and was always getting 'stopped' as a result, even with the song playing. That took me a while to figure out - stupid mistake, I was looking at the filename instead of the handle returned by _SoundOpen........ (i.e, RTFM) Once I figured that out and re-sorted the code around, etc., I was able to get the proper status of 'playing' and then, was able to do the check for 'stopped' instead of the 'brute force' timeout method. So far, no more 'silent' songs (which, btw, before I put in the check for 'stopped', were showing NO status). End result - I believe it was a RACE CONDITION caused by using timing instead of reading _SoundStatus (I believe - more testing will prove that out, but I'm feeling very good about it - couple dozens songs played with no problem instead of every few songs being 'silent') So if you are seeing 'silent' songs, be very careful on the coding - and use the features of the UDF ! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now