Help w/ sound...

Non-platform specific questions.

is game editor...

Poll ended at Thu Dec 30, 2004 9:54 pm

Awesome
1
50%
Really Awesome
1
50%
Very Very cool
0
No votes
 
Total votes : 2

Help w/ sound...

Postby willg101 » Mon Dec 20, 2004 9:54 pm

hey, anyone here know how to use the sound functions?
i don't get what the documentation means when it says 'void setVolume: channel... blah blah blah'
anyone get how to use 'setVolume' 'setPan' 'Stop Sound'?
http://www.wish-games.com
Old betas now available!!
User avatar
willg101
 
Posts: 473
Joined: Thu Dec 16, 2004 12:08 am
Location: West Michigan
Score: 5 Give a positive score

Postby makslane » Mon Dec 20, 2004 11:26 pm

If you can just play a sound file or a music, use the
Play Sound and Play Music actions
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

right, but...

Postby willg101 » Mon Dec 20, 2004 11:32 pm

right, but i would like to change these setting in-game!
http://www.wish-games.com
Old betas now available!!
User avatar
willg101
 
Posts: 473
Joined: Thu Dec 16, 2004 12:08 am
Location: West Michigan
Score: 5 Give a positive score

Postby jazz_e_bob » Tue Dec 21, 2004 5:23 am

Example:

Add a global integer variable called "mySoundChannel".

Using:
mySoundChannel = PlaySound2( soundPath, volume, loop, pan);

You can now use:
setPan(mySoundChannel, pan)
setVolume(mySoundChannel, volume)
stopSound(mySoundChannel)

Image
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

ok

Postby willg101 » Tue Jan 25, 2005 11:51 pm

ok..
I've got the variable:
sf1=PlaySound2("F:\\mem verse.wav", 1.000000, 1, 0.000000);

but when I do:

setPan.("sf1" , ".5");

I've done an "illegal stucture operation"
http://www.wish-games.com
Old betas now available!!
User avatar
willg101
 
Posts: 473
Joined: Thu Dec 16, 2004 12:08 am
Location: West Michigan
Score: 5 Give a positive score

Postby jazz_e_bob » Wed Jan 26, 2005 12:31 am

Whoah. You need a sound demo to play with.

:)

http://www.artsystems.com.au/game%20editor/sonic%20invaders.zip

Use left and right arrow keys.

Up to shoot.

Can't shoot again until bullet destroyed.

Too easy? Turn you monitor off and play using sound alone.
Controlling complexity is the essence of computer programming.
User avatar
jazz_e_bob
 
Posts: 742
Joined: Tue Jul 01, 2003 9:38 pm
Location: Bloke from Cockatoo Creek Australia
Score: 14 Give a positive score

Re: ok

Postby makslane » Wed Jan 26, 2005 12:24 pm

willg101 wrote:setPan.("sf1" , ".5");


Your sf1 variable must be an Integer (int) and in the setPan function you must use numerical values without quotes:

setPan(sf1, .5);
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

...

Postby willg101 » Sat Jan 29, 2005 5:39 pm

OK...
Now how do you get it so that the sound doesn't play over and over when you change pan/volume?

Also-
Is it possible to use all variables like this:
Code: Select all
sf1=PlaySound2("var1", var2, var3, var4);


Never mind! :oops:
it works.

OK.
Now we reach another question:
pretending that "var1" is the file name(still focussing up there with that code), if I did:
Event Add->Mouse Button Up->Conditional Action->actor2.text=1->add-script editor->var1=f:\soundfile
would this work after I exported it?
http://www.wish-games.com
Old betas now available!!
User avatar
willg101
 
Posts: 473
Joined: Thu Dec 16, 2004 12:08 am
Location: West Michigan
Score: 5 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest