Yazgul Posted October 7, 2017 Posted October 7, 2017 (edited) Okay like this is the error : >"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\Boro\Desktop\Skolaaa.au3" "C:\Program Files (x86)\AutoIt3\Include\Sound.au3" (261) : ==> Subscript used on non-accessible variable.: __SoundMciSendString("set " & $aSndID[0] & " time format milliseconds") __SoundMciSendString("set " & $aSndID^ ERROR >Exit code: 1 Time: 114 If i use wav or wma files it works perfectly,but if i use mp3 files it gives this error.Any help? expandcollapse popup#include <Array.au3> #include <File.au3> #include <Sound.au3> #include<MsgBoxConstants.au3> Global $aFiles = _FileListToArrayRec("C:\Users\Boro\Desktop\dadada","*.mp3",$FLTAR_FILES, $FLTAR_RECUR) Global $iPos=1 Global $Broj=1 $Pjesma=_SoundOpen("C:\Users\Boro\Desktop\dadada" & "\" & $aFiles[$Broj]) Func Pusti() _ArrayShuffle($aFiles) $Pjesma=_SoundOpen("C:\Users\Boro\Desktop\dadada" & "\" & $aFiles[$Broj]) _SoundPlay($Pjesma) _SoundLength("C:\Users\Boro\Desktop\dadada" & "\" & $aFiles[$iPos],1) Sleep(1000) If _SoundStatus($Pjesma)="0" Then _ArrayShuffle($aFiles) Pusti() EndIf EndFunc Func KrajCasa () Soundplay("C:\Users\Boro\Desktop\New\123.wav",0) Sleep(10000) Soundplay("") _ArrayShuffle($aFiles) Pusti() EndFunc Func PocetakCasa() _SoundStop($Pjesma) Soundplay("") Soundplay("C:\Users\Boro\Desktop\New\123.wav",0) Sleep(10000) Soundplay("") EndFunc Func VelikiOdmor() Soundplay("C:\Users\Boro\Desktop\New\123.wav",0) Sleep(10000) Soundplay("") _ArrayShuffle($aFiles) Pusti() While @Hour=9 And @Min<20 If _SoundPos($Pjesma)=_SoundLength($Pjesma) Then Sleep(5000) Pusti() EndIf If _SoundStatus($Pjesma)="0" Then SoundPlay("") _ArrayShuffle($aFiles) Call("Pusti") EndIf WEnd EndFunc Func MaliOdmor() Soundplay("C:\Users\Boro\Desktop\New\123.wav",0) Sleep(10000) Soundplay("") _ArrayShuffle($aFiles) Pusti() While @Hour<=11 And @Min<5 If _SoundPos($Pjesma)=_SoundLength($Pjesma) Then Sleep(5000) Pusti() EndIf If _SoundStatus($Pjesma)="0" Then SoundPlay("") _ArrayShuffle($aFiles) Call("Pusti") EndIf WEnd EndFunc While 1 If @Hour=7 And @MIN=30 And @Sec=0 Then PocetakCasa() If @Hour=8 And @Min=15 And @Sec=0 Then KrajCasa() If @Hour=8 And @Min=20 And @Sec=0 Then PocetakCasa() If @Hour=9 And @Min=5 And @Sec=0 Then VelikiOdmor() If @Hour=9 And @Min=20 And @SEC=5 Then PocetakCasa() If @Hour=10 And @Min=5 And @Sec=0 Then KrajCasa() If @Hour=10 And @Min=10 And @Sec=0 Then PocetakCasa() IF @Hour=10 And @Min=55 And @Sec=0 Then MaliOdmor() If @Hour=11 And @Min-5 And @Sec=5 Then PocetakCasa() If @Hour=11 And @Min=50 And @Sec=0 Then KrajCasa() If @Hour=11 And @Min=55 And @Sec=0 Then PocetakCasa() If @Hour=12 And @Min=40 And @Sec=0 Then KrajCasa() If @Hour=12 And @Min=45 And @Sec=0 Then PocetakCasa() If @Hour=13 And @Min=30 And @Sec=0 Then KrajCasa() If @Hour=14 And @Min=0 And @Sec=0 Then PocetakCasa() If @Hour = 14 And @Min=45 And @Sec=0 Then KrajCasa() If @Hour=14 And @Min=50 And @Sec=0 Then PocetakCasa() IF @Hour=15 And @Min=35 And @Sec=0 Then VelikiOdmor1() If @Hour=15 And @Min=50 And @SEC=5 Then PocetakCasa() If @Hour=16 And @Min=35 And @Sec=0 Then KrajCasa() If @Hour=16 And @Min=40 And @Sec=0 Then PocetakCasa() If @Hour=17 And @Min=25 And @Sec=0 Then MaliOdmor() If @Hour=17 And @Min=35 And @Sec=5 Then PocetakCasa() If @Hour=18 And @Min=20 And @Sec=0 Then KrajCasa() if @Hour=18 And @Min=25 And @Sec=0 Then PocetakCasa() If @Hour=19 And @Min=10 And @Sec=0 Then KrajCasa() If @Hour=19 And @Min=15 And @Sec=0 Then PocetakCasa() If @Hour=20 And @Min=0 And @Sec=0 Then KrajCasa() WEnd Func VelikiOdmor1() Soundplay("C:\Users\Boro\Desktop\New\123.wav",0) Sleep(10000) Soundplay("") _ArrayShuffle($aFiles) Pusti() While @Hour=15 And @Min<50 If _SoundPos($Pjesma,1)=_SoundLength($Pjesma,1) Then Sleep(5000) Pusti() EndIf If _SoundStatus($Pjesma)="0" Then SoundPlay("") _ArrayShuffle($aFiles) Call("Pusti") EndIf WEnd EndFunc Func MaliOdmor1() Soundplay("C:\Users\Boro\Desktop\New\123.wav",0) Sleep(10000) Soundplay("") _ArrayShuffle($aFiles) Pusti() While @Hour=17 And @Min<35 If _SoundPos($Pjesma)=_SoundLength($Pjesma) Then Sleep(5000) Pusti() EndIf If _SoundStatus($Pjesma)="0" Then SoundPlay("") _ArrayShuffle($aFiles) Call("Pusti") EndIf WEnd EndFunc Edited October 7, 2017 by Melba23 Added code tags
Moderators Melba23 Posted October 7, 2017 Moderators Posted October 7, 2017 Yazgul, Your code makes no attempt ot find out if the _SoundOpen call was successful - if it was not then the returned $aSnd value will most likely not be an array and so the UDF will fail. Add some errorchecking after the _SoundOpen call and take appropriate action if the file does not open. As to why it only happens with .mp3 files - I have often found that a corrupt ID2/3 tag can make the file fail to open, so you might want to check that the tags are correct on any file which displays this behaviour. 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
Yazgul Posted October 7, 2017 Author Posted October 7, 2017 Yeah you were right it cant open the file.It doesnt work only on some mp3 files so i will try figuring out why.But also i tried deleting tags and it didnt help...Any other suggestions?
Yazgul Posted October 7, 2017 Author Posted October 7, 2017 Oh it does acctually,but you cant be running any mp3 files in the background :D...Anyway thanks a lot,some weird interaction going on over here but glad it works
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