sTYLE Posted February 6, 2012 Share Posted February 6, 2012 So I have something coded (On AutoIt Ofcourse) and it's almost like a program. I want some music playing in the background when you open the program. Can somebody tell me how to add sound to it? Thanks. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted February 6, 2012 Moderators Share Posted February 6, 2012 Hi, sTYLE, welcome to the forum. Check out SoundPlay and _SoundPlay in the HelpFile. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
sTYLE Posted February 6, 2012 Author Share Posted February 6, 2012 Hi, sTYLE, welcome to the forum. Check out SoundPlay and _SoundPlay in the HelpFile.Thanks for welcoming me And so if I were to put this: SoundPlay(@WindowsDir & "LibrariesMusicMysong.wav", 1) Should it work or am I doing something wrong? Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted February 6, 2012 Moderators Share Posted February 6, 2012 (edited) Let's try it the other way, does it work? If not, are you receiving any errors?Edit: I don't have your Mysong.wav obviously, but I copied another wav file to @WindowsDir & "LibrariesMusic" and your code played it for me just fine. Edited February 6, 2012 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 6, 2012 Moderators Share Posted February 6, 2012 sTYLE, Nice to see you took my advice. It always helps if you post the script you are working on - it gives us something to work on. 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 Link to comment Share on other sites More sharing options...
sTYLE Posted February 6, 2012 Author Share Posted February 6, 2012 (edited) sTYLE, Nice to see you took my advice. It always helps if you post the script you are working on - it gives us something to work on. M23 Okay, So im working on an inside joke. (Friend is good on a game so we call him a cheat) and I followed a few tutorials earlier and found out how to make, windows, GUI's etc, now all I want is a song to play when the program is opened. This is what I have so far: expandcollapse popup#include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <Sound.au3> SoundPlay(@WindowsDir & "LibrariesMusicMysong.wav", 1) GuiCreate("Style's KeVvHook© 2012",465,228,269,193) $button1=GUICtrlCreateButton("C/Dvar Injection",55,135,100,40) $button2=GUICtrlCreateButton("Auto Inject",56,70,100,40) $button3=GUICtrlCreateButton("Inject Manually",285,100,100,40) $input1=GUICtrlCreateInput("Main Hacks",56,28,100,20) $input2=GUICtrlCreateInput("Other Hacks",282,67,100,20) $menu1=GuiCtrlCreateMenu("File") $help = GuiCtrlCreateMenuItem("Help",$menu1) $About = GUICtrlCreateMenuItem("About",$menu1) $exit = GUICtrlCreateMenuItem("Exit",$menu1) $menu2=GuiCtrlCreateMenu("Contact Us") $Email = GUICtrlCreateMenuItem("Email Us", $menu2) $Phone = GUICtrlCreateMenuItem("Phone Us", $menu2) $Address = GUICtrlCreateMenuItem("Address", $menu2) $Group1 = GuiCtrlCreateGroup("Main Hacks",30,10,150,180) $group2 = GUICtrlCreateGroup("KeVv's Extras",275,10,120,180) $menu3 = GUICtrlCreateMenu("How To Use KeVvhook©") $howto = GUICtrlCreateMenuItem("How To Use", $menu3) GuiSetState() While 1 $msg=GuiGetMsg() If $msg=-3 Then cross() If $msg=$button1 Then button1() If $msg=$button2 Then button2() If $msg=$button3 Then button3() If $msg=$help Then help() If $msg=$About Then about() If $msg=$Email then email() If $msg=$Phone Then Phone() If $msg=$Address Then Address() If $msg=$exit Then exit1() If $msg=$button1 Then buttonbox() If $msg=$button2 Then buttonbox2() If $msg=$howto Then howto() WEnd Func help() MsgBox(0, "About KeVvHook©", "KeVvhook 1.7. Designed by netsky sTYLE. this is meant to replicate KeVv's 'skill' ") EndFunc Func about() MsgBox(0, "Need to get skill?", "If you need skill, KeVvhook is the right thing for you!") EndFunc Func email() MsgBox(0, "Email Us", "Email: KeVvBotGetsTheCOD4ChetFrags@hotmail.com") EndFunc Func Phone() MsgBox(0, "PhoneNumber", "Number: 0782CANTSTOPTHEBOT992") EndFunc Func Address() MsgBox(0, "Address", "52 KeVvBot Lane - SCH 37Z") EndFunc Func exit1() MsgBox(0, "Exiting", "KeVvChets De-Injected.. Thanks for using Cant stop the kevv 2012") Exit EndFunc Func buttonbox() MsgBox(0, "Congratulations", "C/DVars Successfully Unlocked!") EndFunc Func buttonbox2() MsgBox(0, "Congratulations", "Auto Inject Completed, Enjoy!") EndFunc Func cross() MsgBox(0, "KeVvHook©", "Visit www.KeVvBot.org.uk For the best hacks around! what's a codehook again?") Exit EndFunc Func howto() MsgBox(0, "How To Use", "Simply load Call Of Duty 4: Modern Warfare©. Once loaded Inject/Unlock what you desire. Enjoy!") EndFunc Func button1() If $msg=$button1 Then $input1=GUICtrlCreateInput("C/DVar's Unlocked",56,28,100,20) EndFunc Func button2() If $msg=$button2 Then $input1=GUICtrlCreateInput("Auto Inject Success", 56,28,100,20) EndFunc Func button3() $message = ("Navigate to COD4 Directory") $var = FileOpenDialog($message, @DesktopCommonDir & ""," COD4(iw3mp.exe)") $File = FileRead($var) If @error Then MsgBox(0, "Inject Unsuccessful", "IW3MP not found!") Else GUICtrlSetData($edit, $file) EndIf EndFunc Edited February 6, 2012 by sTYLE Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 6, 2012 Moderators Share Posted February 6, 2012 (edited) sTYLE,First, when you next post code please use Code tags - put [autoit] before and [/autoit] after your posted code. Then you get a nice scrolling box and syntax colouring. Second - I hope you read those Forum Rules to which i linked and do not try posting any code which actually does any of this stuff. Finally, you are using the wait paramter with SoundPlay so the script pauses until the sound finishes. I suggest just using:SoundPlay(@WindowsDir & "LibrariesMusicMysong.wav")Then the script continues while the music plays. All clear? M23Edit: I see you learnt about tags already. Edited February 6, 2012 by Melba23 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 Link to comment Share on other sites More sharing options...
sTYLE Posted February 6, 2012 Author Share Posted February 6, 2012 (edited) sTYLE, First, when you next post code please use Code tags - put before and after your posted code. Then you get a nice scrolling box and syntax colouring. Second - I hope you read those Forum Rules to which i linked and do not try posting any code which actually does any of this stuff. Finally, you are using the wait paramter with SoundPlay so the script pauses until the sound finishes. I suggest just using: SoundPlay(@WindowsDir & "LibrariesMusicMysong.wav") Then the script continues while the music plays. All clear? M23 Edit: I see you learnt about tags already. I'm sorry about that, fixed anyway! And I know, I don't intend to EVER make it a real game violation, just a practical joke Also, where does the SoundPlay(@WindowsDir & "LibrariesMusicMysong.wav") go? at the bottom or top? because it still doesn't work Edited February 6, 2012 by sTYLE Link to comment Share on other sites More sharing options...
Guest Posted February 6, 2012 Share Posted February 6, 2012 where ever you want to play the sound. Link to comment Share on other sites More sharing options...
sTYLE Posted February 6, 2012 Author Share Posted February 6, 2012 NEVERMIND I HAVE DONE IT! Thanks a BUNCH Melba! true lifesaver!<3 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