Sign in to follow this  
Followers 0
sTYLE

I need help with Sound. I'm new..

10 posts in this topic

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.

Share this post


Link to post
Share on other sites



Hi, sTYLE, welcome to the forum. Check out SoundPlay and _SoundPlay in the HelpFile.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

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._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#6 ·  Posted (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:

#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 by sTYLE

Share this post


Link to post
Share on other sites

#7 ·  Posted (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? ;)

M23

Edit: I see you learnt about tags already. :D

Edited by Melba23

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#8 ·  Posted (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. :D

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. :D

All clear? ;)

M23

Edit: I see you learnt about tags already. :D

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 by sTYLE

Share this post


Link to post
Share on other sites

where ever you want to play the sound.

Share this post


Link to post
Share on other sites

NEVERMIND I HAVE DONE IT!

Thanks a BUNCH Melba! true lifesaver!<3

Share this post


Link to post
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
Sign in to follow this  
Followers 0