Sign in to follow this  
Followers 0
alatedseraph

music

19 posts in this topic

ok no one will answer me on my earlier post so ill make a new one... how do i add music so that it plays over and over again without interfering with the other parts of the program?

Share this post


Link to post
Share on other sites



and is it possible to bind the music with the exe so that the ppl wont have to download 2 different things?

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

and is it possible to bind the music with the exe so that the ppl wont have to download 2 different things?

<{POST_SNAPBACK}>

SoundPlay()

FileInstall()

Edited by emmanuel

"I'm not even supposed to be here today!" -Dante (Hicks)

Share this post


Link to post
Share on other sites

well i know about soundplay i want to make it so that the music is looped so that it replays over and over

Share this post


Link to post
Share on other sites

well i know about soundplay i want to make it so that the music is looped so that it replays over and over

<{POST_SNAPBACK}>

make a adlib that uses timer* funcs to restart the sound after it's done playing?

"I'm not even supposed to be here today!" -Dante (Hicks)

Share this post


Link to post
Share on other sites

its all well and good that u guys tell me wat i could do but i still dont know HOW to do it lol ive only been doing this for 2 days...

Share this post


Link to post
Share on other sites

I'm not saying this to be mean or anythiing, but people around here really don't like it unless you attempt it yourself first. Open up the helpfile, and look for the SoundPlay() function, and for the loops. For While, etc...

Share this post


Link to post
Share on other sites

hey black not to be rude but did u even find out if i tried or not? yes ive tried alot

and larry wat i want is i have a series of questions and answer things and i want the jeopardy music that i have to play over and over while they do the program i have made

Share this post


Link to post
Share on other sites

$music = 1

If $music = 1 Then

SoundPlay("Fileextentionhere.wav or .mp3 or whatever")

EndIf

Share this post


Link to post
Share on other sites

alatedseraph, I have an idea of how to accomplish what you want by using the Run and WinClose functions but I have to do a little more research before I can post some test code (I just started this last night =D).

Share this post


Link to post
Share on other sites

Wow, that is a much more elegant solution than I was thinking of. :ph34r:

Great coding Larry!

Share this post


Link to post
Share on other sites

oh nevermind.... this wouldn't do what you want, not beyond two loops, then it'd keep restarting the music.

Larry, you rock.

$timer = TimerInit()
$length = 3 * 1000 * 60;assuming the song is exactly 3 minutes long
SoundPlay("jeapardy.mp3")
AdlibEnable("musicloop")
;script asking questions
AdlibDisable()

func musicloop()
   if TimerDiff($timer) > $length
      SoundPlay("jeapardy.mp3")
   EndIf
EndFunc

"I'm not even supposed to be here today!" -Dante (Hicks)

Share this post


Link to post
Share on other sites

If $CMDLINE[0] = 1 And $CMDLINE[1] == "/jeopardy" Then Jeopardize()

can u explain what that does plz?


My site for HTML Help :)[quote name='Valik' date='Oct 15 2004, 12:29 PM']Maybe nobody is an "elite uber-coder" like me because thinking is a capital offense in today's online-world?[right][snapback]36427[/snapback][/right][/quote]

Share this post


Link to post
Share on other sites

If $CMDLINE[0] = 1 And $CMDLINE[1] == "/jeopardy" Then Jeopardize()

can u explain what that does plz?

<{POST_SNAPBACK}>

well, it does something differently if you have those values set... how would those values be set you ask? check this out, under command line parameters

"I'm not even supposed to be here today!" -Dante (Hicks)

Share this post


Link to post
Share on other sites

ok well larry i tried wat u put but its not working right... later tonite ill send u the script cause im at school right now but the song is a .mid its located at c:\jeopardy.mid as of right now i have it so that after each question it starts the music until u press ok then it goes to the second question thing and restarts the music again so its like waiting music it plays until u are finished with doing the calculations... wat i want it to do is play the entire time not having to restart after everyone...

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

here is kinda how it goes... needs to be compiled...

If $CMDLINE[0] = 1 And $CMDLINE[1] == "/jeopardy" Then Jeopardize()

;regular script goes here...
;
;Run Jeopardy music like...
Run('"' & @SCRIPTFULLPATH & '" /jeopardy')
WinWait("Jeopardy Music")
;
;ask questions here...
;
;kill music
WinClose("Jeopardy Music")

Func Jeopardize()
   AutoItWinSetTitle("Jeopardy Music")
   While 1
      SoundPlay("jeopardy.mp3",1)
      Sleep(1000)
   Wend
EndFunc

<{POST_SNAPBACK}>

ok here is my code... the games pretty pathetic but im limited on my imagination lol  anyway here

<{POST_SNAPBACK}>

I believe that what Larry had meant was for you to put all of your questions in the area where ";ask questions here..." is. The music is handled by the app running itself a second time, in the background.

ps, you missed the closing [/ code] tag and that's why your post is malformed. :ph34r:

pps, that is the way Jeopardy works though, isn't it? they only play the music at the beginining of a question :(

Edited by emmanuel

"I'm not even supposed to be here today!" -Dante (Hicks)

Share this post


Link to post
Share on other sites

Script suggestion:

Put your questions in an external text file and read them in as you go. This will shorten your code and make your script more maintainable.

*** Matt @ MPCS

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