PDA

View Full Version : How To Add Music To Your Script.



P1nky
10-16-2008, 09:39 PM
This Tut Will teach you how to use a basic function Scar has.

which is called:
PlaySound(ScriptPath + ' ');

Step 1:
add this where ever you want(Main Loop, which sounds most reasonable).

Step 2:

Now Download the Music you want(Bearshare/Limewire/ect.)

Step 3:

Once you Download the Music you will add the music in the function which would look like this:

PlaySound(ScriptPath + 'JOKER.wav');
---THATS IT HOW TO ADD MUSIC---
-------------------------------------------------------------------------

MOST IMPORTANT:
the file must be .WAV format
there are quite a bit free format converters get the 1 Mp3 to WAV.
I USE:
http://www.nch.com.au/switch/
CLICK TO DOWNLOAD(It Is the Free Version):
http://i36.tinypic.com/kyyxz.gif (http://www.nch.com.au/switch/switchsetup.exe)

NOTE: ALWAYS REMEBER THE FORMAT MUST BE .WAV!!! THATS WHAT IT WILL ACCEPT, NOTHING ELSE!



MORE INFO:

if your song is long, try your best to get a shorter version if not, than get it to overlap by something small, this is what i used in my Powerchopper(AnyWherePowerChopper):

begin
setupsrl;
PlaySound(ScriptPath + 'Whats Love.WAV');//HADDAWAY FTW?
smartSetupex(SmartWorld, True, True, False); PlaySound(ScriptPath + 'Whats Love.WAV');//HADDAWAY FTW?
Wait(10000);
SetTargetDC(SmartGetDC);
PlaySound(ScriptPath +'Spider Pig.WAV'); // I LOVE YOU HOMER LOL!
SRLPlayerForm(True, [], [], [], []);
end;
that should explain all^^^

Whats Love - Aprox. 3 mins long
Spider Pig.WAV- about 10-15 secs long

so i got it to overlap and stops "whats love" and goes to "spider pig", and than it stops.
----------------------------------------------------------------------

How To Release to The Public.
NOTE: i do not know how to download includes/files from site, ask someone who does or post here to tell us thanks.

Step 1) like HTML; you have to save the files in the same folder the script is.
Example:
http://i34.tinypic.com/2mc8206.jpg
Please ignore the txt, imagine that .wav;

okay now, when you get everything in 1 folder(can be anywhere you want).

Step 2)
Now Make a .Rar Symbol should look like:
http://i33.tinypic.com/29f9lq8.jpg
NAME IT WHAT EVER YOU WANT, remember people will be able to see the name you chose!

hope you got downloaded if not heres the website to get it downloaded:
www.rarlab.com/

step 3)
Now drag/or copy all your components(.wav/.txt/.scar)
NOTE: you can put text in there like a READ ME thing , thats what i do:redface:
and Drop/Paste into the .rar you created.

Step 4)
SINCE SRL DOESNT LET YOU ATTACH .RAR (Please Change :) for convienient)
You Must Upload it Use whatever you want i prefer:
www.filefront.com
*Pure Ownage*

Step 5) now your done hope your music file isnt big, if it is try to short it down or people would hate it to wait around 2-4 mins or w/e.

NOW YOUR DONE GUYS
I PRETTY MUCH COVERED MOSTLY EVERYTHING, IF NOT PLEASE TELL ME !



If you want it to pause the script while the sound plays,

wait(GetSoundDuration('sound.wav'));
Thanks For Letting Us KNOW!

REP ME IF YOU LOVE ME!!!! AND READ MY OTHER GUIDES THANKS!

P1nky
10-16-2008, 09:41 PM
If a Admin/mod please move this to Juniors Much Appreciated(ill like it to be in intermediate). thanks!

TheChineseMan
10-16-2008, 10:40 PM
wow ty sooo much!!!!!! rep ++ :)

P1nky
10-16-2008, 10:47 PM
np, thanks for rep :)
btw it be better if you use on forms mostly<forgot to mention that loL>

Runescapian321
10-16-2008, 10:47 PM
Already knew how to do this but nice guide :) Rep++

Very useful for editing into scripts so that music starts playing when the script stops ;)

n3ss3s
10-17-2008, 01:45 PM
I think PlaySound plays the sound, then continues the script, e.g you won't mine while the music plays...

Runescapian321
10-17-2008, 03:01 PM
I think PlaySound plays the sound, then continues the script, e.g you won't mine while the music plays...

Well, when I used to use it for hearing when a script would end, I would have

PlaySound(blah blah);
TerminateScript;

And the whole song would play. So I'm guessing that PlaySound just starts the 'sound' and lets it play the whole way through no matter what.

n3ss3s
10-17-2008, 03:47 PM
RuneScapian, ofcourse it played the whole song, first PlaySound plays the full song and then terminatescript terminates it.

Runescapian321
10-17-2008, 04:34 PM
I seem to recall that it starts playing the song then says 'Successfully Executed', but I'm not positive, I'll try it out in a bit.

EDIT: Yup, this script -

program New;
begin
PlaySound('C:\WINDOWS\Media\Usher, Lil Jon & Ludacris - Yeah.wav');
end.

Says this


Successfully compiled (3583 ms)
Successfully executed

And is playing music atm :)

P1nky
10-17-2008, 08:45 PM
no, it will run the script and the music at the same time.

Naike
10-17-2008, 10:10 PM
Joker - Grats on making a great and useful tut! *for once*.

Will use this later on :)

P1nky
10-18-2008, 02:27 AM
hahaha, thanks mate :P you really make me laugh lol.

Daniel
10-18-2008, 02:31 AM
Wow, no offence, but it's quite easy ;) I never knew something like this would be really appreciative to other people :p

Good job anyway ;) You obviously used your time to create something that people will like ;)

BTW, this would belong in the Beginners section, Intermediate is not worthy for this :p

P1nky
10-18-2008, 04:43 AM
Wow, no offence, but it's quite easy ;) I never knew something like this would be really appreciative to other people :p

Good job anyway ;) You obviously used your time to create something that people will like ;)

BTW, this would belong in the Beginners section, Intermediate is not worthy for this :p

hmm i just didnt want it in beginners section, than the beginners, would use this easy function and the rest of the script shitty lol.

Smartzkid
10-20-2008, 01:48 AM
PlaySound tells windows to play a sound, then goes on while windows happily plays the sound. So yes, it does continue the script while the sound plays.

If you want it to pause the script while the sound plays,

wait(GetSoundDuration('sound.wav'));

P1nky
10-22-2008, 03:04 PM
Thanks , whoever moved it


PlaySound tells windows to play a sound, then goes on while windows happily plays the sound. So yes, it does continue the script while the sound plays.

If you want it to pause the script while the sound plays,

wait(GetSoundDuration('sound.wav'));

oh thanks ill add that on to the guide :P