Baku Posted August 7, 2005 Posted August 7, 2005 Well, it's very quick to explain. I wanna loop this: SoundPlay($sound, 0) . But how? The musicfile has to be played till it the app closes. But how? If loop the plain cmd it doesnt work coz it starts from the beginning all the time. I already tried it with timediff(), but i guess i havnt made that well, maybe someone of u can do that. But well, i'm actually not care how this happens, its just important that it works I hope sum1 can help.thx in advance
Moderators SmOke_N Posted August 7, 2005 Moderators Posted August 7, 2005 (edited) Never played with avi's before, but try this in your loop to start the avi: $avi = FileOpen($sound, 0) If Not $avi = -1 Then SoundPlay($sound, 0) EndIf That way it just skips over it if it's open in your loop statement. Hope it works 4 ya! Edit: Forgot "/" for end code tag Edited August 7, 2005 by ronsrules Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Baku Posted August 7, 2005 Author Posted August 7, 2005 hm... I dont get it, its not an avi, its an mp3-sound. Ur method worked well, but it doesnt loops the thing
Moderators SmOke_N Posted August 7, 2005 Moderators Posted August 7, 2005 Sorry, sound / clips what the hell... Nah, I've been up for 2 days almost, getting delerious.... That's my bad w/ the $avi... could just name it $CheckSound. What do you mean it doesn't loop? Should probably have it like this: $CheckSound = FileOpen($sound, 0) If Not $CheckSound = -1 Then SoundPlay($sound, 0) Else FileClose($CheckSound) <-- EndIf Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
hgeras Posted August 7, 2005 Posted August 7, 2005 (edited) This will work only if the duration is short.... If your file is 3 mins for instance,I am not sure if this will work due to limitations of autoit maybe. You will have to take advantage of Adlib in that case and thats because SoundPlay() doesnt have any Return Values..... AdlibEnable("PlayLoop",30000) Func PlayLoop() SoundPlay($sound) EndFunc If the duration of sound is 30secs then make adlib check every 30secs(30000ms) and restart the sound.... If duration is much longer then you would have to use Timer in the AdLib section.... I hope this will suit you well... C ya Edited August 7, 2005 by hgeras Useful information about COM/Objects referenceMy Scripts:PapDefragNvidia Temperature Logger V3.0 with graph analyzerAutoiIt Update Checker And Downloader V1.0ArrayPush UDF
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