How to stop music?

Game Editor comments and discussion.

How to stop music?

Postby Clokio » Mon May 30, 2011 7:28 pm

Now when I press a button I want it to stop. What is it, and can it be done in script too?

Thanks
Clokio
 
Posts: 229
Joined: Tue May 17, 2011 2:18 pm
Score: 32 Give a positive score

Re: How to stop music?

Postby schnellboot » Mon May 30, 2011 8:23 pm

you could have used the search function, but I did it for you
http://game-editor.com/forum/viewtopic.php?f=2&t=7495
schnellboot
 
Posts: 819
Joined: Sat Mar 31, 2007 1:35 pm
Location: Germany
Score: 102 Give a positive score

Re: How to stop music?

Postby sonicfire » Wed Jun 01, 2011 11:10 am

Best is to define a global integer called "musicCh" or "soundCh".
Then when playing the music call it like this:

Code: Select all
soundCh = playSound2("soundfile",1,1,0);


If you want to stop it, use this anywhere in a script:
Code: Select all
stopSound(soundCh);


Hope that helps :)
sonicfire
 
Posts: 425
Joined: Wed Nov 01, 2006 9:34 pm
Location: berlin germany
Score: 16 Give a positive score

Re: How to stop music?

Postby Game A Gogo » Thu Jun 02, 2011 1:15 am

I think no one though about playing a 1ms long empty wav file once?
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: How to stop music?

Postby Clokio » Thu Jun 02, 2011 3:34 am

Game A Gogo wrote:I think no one though about playing a 1ms long empty wav file once?


Your right, I am probably the best dummy ever in the video game design-programmation. And I am a great asset to wherever community I stay :P . Cause when a game engine tweek their doc for dummy like me, they get alot of those, and they get better cause they suceed.

Ex: putting the moon defender as the first tutorial, it's quite not dummy proof.
The doc is great, focus on starters, but maybe in wrong order. I might give a word about it later.
Clokio
 
Posts: 229
Joined: Tue May 17, 2011 2:18 pm
Score: 32 Give a positive score

Re: How to stop music?

Postby schnellboot » Thu Jun 02, 2011 6:25 am

but caveman is dummy proof I assure you
schnellboot
 
Posts: 819
Joined: Sat Mar 31, 2007 1:35 pm
Location: Germany
Score: 102 Give a positive score

Re: How to stop music?

Postby skydereign » Thu Jun 02, 2011 6:47 am

Clokio wrote:
Game A Gogo wrote:I think no one though about playing a 1ms long empty wav file once?


Your right, I am probably the best dummy ever in the video game design-programmation. And I am a great asset to wherever community I stay :P . Cause when a game engine tweek their doc for dummy like me, they get alot of those, and they get better cause they suceed.

Ex: putting the moon defender as the first tutorial, it's quite not dummy proof.
The doc is great, focus on starters, but maybe in wrong order. I might give a word about it later.

There are a lot of users that share in your struggle. We are working on improving things, but it will take some time before any of the planned changes are made. Hang in there and keep up the good input.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: How to stop music?

Postby rykein » Thu Jun 02, 2011 7:34 am

Game A Gogo wrote:I think no one though about playing a 1ms long empty wav file once?

what do you mena by this? you mean like if the sound finishes but then you go to stop it you could be stopping something else? if so sky told me awhile back of a way to prevent it. pretty much if i remember it correctly it was to create an array for the channels and then set the length in it. the view would call a function to lower the counts of the arrays which if 0 would not contain a sound. if that isnt im intrigued as to what you did mean.
rykein
 
Posts: 63
Joined: Mon Jul 26, 2010 7:26 am
Score: 6 Give a positive score

Re: How to stop music?

Postby Clokio » Thu Jun 02, 2011 10:52 am

schnellboot wrote:but caveman is dummy proof I assure you

I am sure you will suceed. There is already alot of good things on the the site. Ex: testimony, you get to know who the engine is for.

A trend on new beginer is they (like me) can't make the difference between what game they played and what it take to make them. That is why I did start with 3D, thinking I din't want to learn 2D. I din't know I had stuff to learn. I would lough at other people games and din't know how they did it. I find out that sometime it's more complicated than I tought it would be. I tested many engines that pretend to be easy, wow compare to what, they never tell. It was probably compared to build your own engine in c++. I actually know a guy that did it. Took him many years like 30.
Clokio
 
Posts: 229
Joined: Tue May 17, 2011 2:18 pm
Score: 32 Give a positive score

Re: How to stop music?

Postby Game A Gogo » Thu Jun 02, 2011 8:23 pm

rykein wrote:
Game A Gogo wrote:I think no one though about playing a 1ms long empty wav file once?

what do you mena by this? you mean like if the sound finishes but then you go to stop it you could be stopping something else? if so sky told me awhile back of a way to prevent it. pretty much if i remember it correctly it was to create an array for the channels and then set the length in it. the view would call a function to lower the counts of the arrays which if 0 would not contain a sound. if that isnt im intrigued as to what you did mean.

What you said sounds complicated so I'll go ahead and say it's not what he wanted lol He wanted his music (Music plays only on ONE channel, the first one) to stop, simple as that :) so playing an empty music will stop the music
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Re: How to stop music?

Postby rykein » Thu Jun 02, 2011 9:42 pm

oh i thought you were talking sounds like sonicfire was. yeah that seems to be the only way feature request!
rykein
 
Posts: 63
Joined: Mon Jul 26, 2010 7:26 am
Score: 6 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest