HAL9000 Posted May 8, 2008 Share Posted May 8, 2008 #cs ---------------------------------------------------------------------------- AutoIt Version: 3.2.10.0 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here #include <Sound.au3> $var= FileOpenDialog ("Select","","Musica (*.mp3;*.wma;*.wav)",1) $sound = _SoundOpen($var, "Startup") If @error = 2 Then MsgBox(0, "Error", "The file does not exist") Exit ElseIf @error = 3 Then MsgBox(0, "Error", "The alias was invalid") Exit ElseIf @extended <> 0 Then $extended = @extended;assign because @extended will be set after DllCall $stText = DllStructCreate("char[128]") $errorstring = DllCall("winmm.dll","short","mciGetErrorStringA","str",$extended,"ptr",DllStructGetPtr($stText),"int",128) MsgBox(0, "Error", "The open failed." & @CRLF & "Error Number: " & $extended & @CRLF & "Error Description: " & DllStructGetData($stText, 1) & @CRLF & "Please Note: The sound may still play correctly.") Else MsgBox(0, "Success", "The file opened successfully") EndIf MsgBox(0, "Sound Length", "The Sound has a length of:" & @CRLF & "hh:mm:ss - " & _SoundLength($sound, 1)) for every file (mp3 ect) --------------------------- Sound Length --------------------------- The Sound has a length of: hh:mm:ss - 00:00:00 --------------------------- OK --------------------------- I think this is a bug of autoIt 3.2.10.0 Link to comment Share on other sites More sharing options...
weaponx Posted May 8, 2008 Share Posted May 8, 2008 This has been asked quite a few times.http://www.autoitscript.com/forum/index.ph...;hl=soundlengthhttp://www.autoitscript.com/forum/index.ph...l=sound++length Link to comment Share on other sites More sharing options...
HAL9000 Posted May 8, 2008 Author Share Posted May 8, 2008 This has been asked quite a few times.http://www.autoitscript.com/forum/index.ph...;hl=soundlengthhttp://www.autoitscript.com/forum/index.ph...l=sound++lengththank you i will try the solution 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