is it possible to fade sfx in/out at the individual sound level?
old_kipper
Member Posts: 1,420
I have a problem after trying to change volume in an individual sound level. The global is no problem, but not much use in this case as I want to use rules to switch out a sound but have to keep it in sync with a new sound.
thanks
kipper
thanks
kipper
Comments
Maybe use more than one attribute to create channels...
game.Sound * game.Channel.1
So if game.Sound is 1 and game.Channel.1 is 1... then the sound is played at maximum value,
If the game.Sound is .5 and the game.Channel.1 is .5... then the sound is played at .25
If the game.Sound is 1 and the game.Channel.1 is 0... then the sound is played at 0
I have tried referencing a level from an attribute (I checked with a text display object to make sure it was changing), from the volume of the sample in the actor but this seems only to apply at the start of the playing of the sample...
As I say, the global is useless in this case, and If I could split the sound across the music and sound channels I wound but I have music as well...
any thoughts?
thanks
kipper
game.sound is a global sound volume (It can be like game sound preferences.)
game.channel.1 is a group that can be controlled separately.
When you want to fade the sound of the channel 1 sounds... just interpolate that attribute to zero. The sound should keep playing... without any sound though... and then interpolate back to 1 to make the sound heard again.
Maybe I'm not being clear enough...
In the volume section of the play sound behavior, two attributes are placed there...
game.sound * game.channel.1
The asterisk means multiplication... game.sound times game.channel.1
Then surely your global attribute (or a scene attribute) should work just fine.
So in your play Sound Volume, put the boolean attribute, SoundAVol for instance. When your certain events happen, make SoundAVol either 0 or 1 accordingly.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
So when you place a sound in an actor you can set it to a channel... by adding the string
game.sound * game.channel.1
then to alter that channel you address it through something like
change attribute game.sound0.2 game.channel.1 to drop it from 1 to 0.2?
I am sorry about this.
kipper
But I am more confused.. Where's gyro's post gone?
Hope Photics suggestion works out for you! :-)
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
So... I'll start over and I'll assume that you don't have the book.
With my GameSalad games, I like to create a game attribute called game.sound. Then, whenever I use the "Play Sound" behavior, I put the game.sound behavior in the volume field. That way... if I want to decrease the volumes of all sounds, I simply use the "Change Attribute" behavior... or I can use Interpolate to create a fade in/out effect.
From the way I understand the scenario, I think that's all you need. You can create channels by creating different attributes.
If you want to combine both — a global volume control and volume groups (channels) that's where the multiplication enters the picture.
If I want the whole game volume to be at 100% volume, I set game.Sound to 1.
If I want to set "Channel 1" Sounds to 50%, I set game.Channel.1 to .5
So... 1 x .5 = .5 ...or 50%
In your scenario, you want to silence one set of sounds.
So... 1 x 0 = 0 ...or mute sound.
By using attributes to group your actors, you can create "Channels". Rocks could use the Channel.1 attribute and Wooden Blocks could get the Channel.2 attribute. So if your character suddenly got a shield that reduced damage from rocks by 50%, Channel.1 could be set to .5.
It's just a theory. I haven't tested it. I haven't actually had a need to group GameSalad sound effects yet.
Thanks anyway.
kipper
p.s. I do have your book and a have used it usefully, Thanks. It's been good reference for stuff and helped out a lot.
cheers kipper
...but with large sound files, I'm thinking that might create memory/loading issues.
...also, you could mix it... one sound file could be imported as a music file and another imported as sound. With BOT, the sounds played while adjusting the sound volume is actually a music loop. I just imported it as a sound file, in order to have greater control over the volume.
Please do let me know if you find it is possible. I just can't think how.
kipper
Imported one music loop as a sound.
Imported another music loop as a sound.
I put two "Play Sound" attributes on a single actor.
One Play Sound has game.Channel 1 as an attribute for volume.
The other has game.Channel 2 as an attribute for volume.
I created a rule... if the key "1" on the keyboard is pressed, interpolate game.Channel 1 to 1
Otherwise... interpolate to 0.
I created another rule... if the key "2" on the keyboard is pressed, interpolate game.Channel 2 to 1
Otherwise... interpolate to 0.
I was then able to fade in and out songs by pressing keys on the keyboard. They would play continuously... even if the volume is set at zero.
but thanks. will see you when I surface....
kipper