Tomb Posted April 9, 2008 Share Posted April 9, 2008 (edited) _SoundLength just isn't working for me. I did a search, and people recently had this problem, but i read it was fixed. I have the latest version of autoit, not the beta though ( i don't like using beta). how can i make _SoundLength work? it just fails. like if i did this. _SoundOpen(@DesktopDir & "\Music\1.mp3", $Current) MsgBox(0, "", _SoundLength($Current, 2)) i also tried doing it this way. _SoundOpen(@DesktopDir & "\Music\1.mp3", $Current) $length = _SoundLength($Current, 2) MsgBox(0, "", "length is " & $length) but still fail. why is autoit being cruel to me? yes i am including the Sound.au3 #include <Sound.au3> and the song path is correct. and i can play the song with _SoundPlay. just can't get the length. Edited April 9, 2008 by Tomb616 Link to comment Share on other sites More sharing options...
panlatv Posted April 9, 2008 Share Posted April 9, 2008 (edited) Hello i have the same problemexemple (_SoundLength no work, but _SoundPos work fine).#include <Sound.au3> $sound=_SoundOpen ("C:\fix.wav") $vor=_SoundLength ($sound, 2) MsgBox (0,"Time",$vor)I have the last autoit (Nov 25 2007 09:22:42).ps: where is the "attached version" here? http://www.autoitscript.com/forum/index.ph...mp;#entry440847sorry for my bad englishedit: the solutiondowload the beta autoit-v3.2.11.5-sfx.exe, but not install, just extract, move the sound.au3 in the Include directory of the stable autoit. (C:\Program Files\AutoIt3\Include\ by default ) (make a backup of the orginal)Now all work fine, good job.http://www.autoitscript.com/autoit3/files/beta/autoit/ Edited April 10, 2008 by panlatv Link to comment Share on other sites More sharing options...
Tomb Posted April 9, 2008 Author Share Posted April 9, 2008 Hello i have the same problem exemple (_SoundLength no work, but _SoundPos work fine). #include <Sound.au3> $sound=_SoundOpen ("C:\fix.wav") $vor=_SoundLength ($sound, 2) MsgBox (0,"Time",$vor) I have the last autoit (Nov 25 2007 09:22:42). ps: where is the "attached version" here? http://www.autoitscript.com/forum/index.ph...mp;#entry440847 sorry for my bad english edit: the solution dowload the beta autoit-v3.2.11.5-sfx.exe, but not install, just extract, move the sound.au3 of the Include directory of the stable autoit. (C:\Program Files\AutoIt3\Include\ by default ) (make a backup of the orginal) Now all work fine, good job. http://www.autoitscript.com/autoit3/files/beta/autoit/Nice work. can you attach the Sound.au3 for me? Link to comment Share on other sites More sharing options...
panlatv Posted April 9, 2008 Share Posted April 9, 2008 Yes i can Sound.au3 Link to comment Share on other sites More sharing options...
Tomb Posted April 9, 2008 Author Share Posted April 9, 2008 Yes i can it is still returning nothing as length after placing it in includes folder. Link to comment Share on other sites More sharing options...
panlatv Posted April 10, 2008 Share Posted April 10, 2008 it is still returning nothing as length after placing it in includes folder. Sorry, but are you certain that autoit can play mp3? For me , it can't . Only wav file. Link to comment Share on other sites More sharing options...
Squirrely1 Posted April 10, 2008 Share Posted April 10, 2008 (edited) Here is a way to get the duration of the .mp3 - $SoundFile = "1.mp3" $folder = @DesktopDir & "\Music" ;Based on gaFrost's FileExtProperties - kudos to simucal $objShell = ObjCreate("Shell.Application") $objFolder = $objShell.Namespace ($folder) For $strFileName In $objFolder.Items If $objFolder.GetDetailsOf ($strFileName, 0) = $SoundFile Then $duration = $objFolder.GetDetailsOf ($strFileName, 21) ExitLoop EndIf Next MsgBox(0, "MP3 Duration", $duration) It is strongly recommended that you do not store folders or files other than shortcuts on the desktop - its a memory hog. Edited April 10, 2008 by Squirrely1 Das Häschen benutzt Radar 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