Jump to content

Subscript used on non-accessible variable for _Soundopen


Yazgul
 Share

Recommended Posts

This is the error:

>"C:\Program Files (x86)\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\Boro\Desktop\Skolaaa.au3"    
"C:\Users\Boro\Desktop\Skolaaa.au3" (9) : ==> Subscript used on non-accessible variable.:
$Ajmo=_SoundOpen("C:\Users\Boro\Desktop\dadada" & "\" & $aFiles[$Broj])
$Ajmo=_SoundOpen("C:\Users\Boro\Desktop\dadada" & "\" & $aFiles^ ERROR
>Exit code: 1    Time: 0.2995

The script is not finished but i cant finish it without a variable for _Soundopen,but somewhy its bugged only on this script.I tried the same thing on other script and it worked.

I tried changing variables but it didn't help.Also tried changing to Global and Local but still nothing.Can someone help me ? :D

#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
 $Ajmo=_SoundOpen("C:\Users\Boro\Desktop\dadada" & "\" & $aFiles[$Broj])
Call ("Ajde")
Func Pusti()
 _SoundOpen("C:\Users\Boro\Desktop\dadada" & "\" & $aFiles[$iPos])
 _SoundPlay("C:\Users\Boro\Desktop\dadada" & "\" & $aFiles[$iPos] , 1)
 _SoundLength("C:\Users\Boro\Desktop\dadada" & "\" & $aFiles[$iPos])

 EndFunc
Func KrajCasa ()

 Soundplay("C:\Users\Boro\Desktop\New\123.wav",0)
Sleep(10000)
Soundplay("")
_ArrayShuffle ( $aMusic)
_ArrayShuffle($aFiles)
SoundPlay("C:\Users\Boro\Desktop\dadada" & "\" & $aFiles[$iPos] , 0)

   EndFunc


Func VelikiOdmor()
   Soundplay("C:\Users\Boro\Desktop\New\123.wav",0)
   Sleep(10000)
   Soundplay("")
_ArrayShuffle ($aMusic)
_ArrayShuffle($aFiles)
Call("Pusti")
While @Hour=16 And @Min<40
If _SoundLength($Pjesma)=_SoundPos($Pjesma) Then
   SoundPlay("")
   Call("Pusti")
EndIf

WEnd
EndFunc

Call("VelikiOdmor")

Link to comment
Share on other sites

  • Developers

Couple of things:

  • You aren't showing the whole script as you have a call to a FUNC that isn't shown: Call ("Ajde")
  • Don't use Call() but simply do :  VelikiOdmor()
  • You aren't testing for the success of the   _FileListToArrayRec() and assume there is an Array with at least 2 places. Check for the @Error & [0]  to know the number of files returned.
  • There are a couple of other warnings when ran through au3check.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...