How to know the duration of an mp3 file using the _SoundLength function?
I've made this:
AutoIt
;Made by TheWebZ #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Sound.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Music Player", 615, 438, 192, 124) $Button1 = GUICtrlCreateButton("Play", 160, 312, 265, 97) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $musica = FileOpenDialog( "Choose your music file", "", "Musica(*.mp3)", 2 ) $som = _SoundOpen( $musica ) $Tempo = _SoundLength( $som ) MsgBox( 16, "Music Length", "Length: " & $Tempo ) SoundPlay( $musica, 0 ) EndSwitch WEnd