Preventing volume from overloading

Non-platform specific questions.

Preventing volume from overloading

Postby mcavalcanti » Wed Oct 05, 2011 5:02 pm

Hello, guys. I read the text below on GE site, but I did not understand how to create the user defined function to prevent volume from overloading. Please, anybody can help me to understand this?

"It's best to create sound functions and call them as needed; if you use the specific sound functions all over in various scripts, it will be difficult to control them later on. In addition, you may want to send all explosions and shots to one user defined function, so that there you can limit the number of explosion sounds to play at once (to prevent the volume from overloading)."

Thanks.
Mario Cavalcanti
----------------------------
Code is poetry.
User avatar
mcavalcanti
 
Posts: 54
Joined: Fri Jul 22, 2011 1:09 am
Location: Rio de Janeiro, Brazil
Score: 1 Give a positive score

Re: Preventing volume from overloading

Postby mcavalcanti » Mon Oct 10, 2011 12:45 am

Please, I would like to understand this. May anybody help me?
Mario Cavalcanti
----------------------------
Code is poetry.
User avatar
mcavalcanti
 
Posts: 54
Joined: Fri Jul 22, 2011 1:09 am
Location: Rio de Janeiro, Brazil
Score: 1 Give a positive score

Re: Preventing volume from overloading

Postby skydereign » Mon Oct 10, 2011 1:01 am

It kind of depends. Not quite sure how DST meant to determine when a sound has ended, but essentially the function can count the number of explosion sounds played. Using that, the function can limit the total number of explosions, or any other type of sound effect. You could create an actor to handle sounds, and use SendActivationEvent and actor variables to determine what sounds to play (and use timers to determine when sounds have stopped). The main point though is that if you use a function to play sounds, then you can change the volume in one place (the function) and have it changed for all instances that you play the sound.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Preventing volume from overloading

Postby Hblade » Mon Oct 10, 2011 3:31 am

-Sky is right. BUT if you want an easier but less-effective method, (may also intterupt sound from other actors) use this.
Code: Select all
StopSound(1); //Untested but find the stopsound function if this fails

PlaySound(Your sound);


This would stop the sound before playing it.
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Preventing volume from overloading

Postby mcavalcanti » Tue Oct 11, 2011 8:19 pm

Thanks to you both.
Mario Cavalcanti
----------------------------
Code is poetry.
User avatar
mcavalcanti
 
Posts: 54
Joined: Fri Jul 22, 2011 1:09 am
Location: Rio de Janeiro, Brazil
Score: 1 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest