User Tag List

Results 1 to 5 of 5

Thread: How to make audio volume different for sound effects and music?

  1. #1
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    TheKruk666's Avatar
    Join Date
    Aug 2016
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to make audio volume different for sound effects and music?

    My goal is to make option to change volume of sound effects and music separately. Currently i'm using "Play sample" and right after that in the same event "Set sample volume", and im changing it to global value for sound volume, and for music sample I use global value for music. This works fine until I change the volume to very low. When its very low, like 10%, somtimes for a split of second I can hear a loud glitch like sound. I guess the cause is that changing volume doesnt work and I hear that sound in 100% for a split second. Is there a better way to handling audio?

    events.png
    video presenting the problem: https://www.youtube.com/watch?v=sWNNtcO1UBc

  2. #2
    Clicker Fusion 2.5Fusion 2.5+ DLC
    Sleepy's Avatar
    Join Date
    Dec 2019
    Posts
    17
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Hello ^^
    I think this happen because you set the volume after beginning to play the sound
    You can use " Play Sample on Specific Channel " and use 2 values ( or more if you need fading ) to set the Music's Volume and the Sound Effect's Volume. By using specifics channel only for music and the others for sound effects you can easly control volume of each one.

    Here is a little exemple ( I use channel 47 and 48 for music, the others for sound effect but you can select what you want ^^ ) :
    26.PNG
    You set the volume at the very beginning and after that you can play any sounds and music, this way the sample will play at the channel volume without needing to change the volume when calling the sample.

  3. #3
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    TheKruk666's Avatar
    Join Date
    Aug 2016
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi, thank you for replying.
    So I understand that I have to play every sound on different channel, and I have to remember which channel is already taken. That makes things a lot more complicated. And its not ideal, because I cant play two long sound on the same channel when they are generated from the same event, with short time interval, because the first sound will stop playing when the second starts. For example an explosion sound effect suffer from this issue.

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleMac Export Module
    dsilvers's Avatar
    Join Date
    Jun 2008
    Location
    Boston, MA
    Posts
    630
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    What I did in my game was create a Channel Controller object and basically run the sound effects through that. You have a value per used channel, and when they = 1, play a specific sound effect. It adds a few more lines of code but it does help keep sound effects organized.

  5. #5
    Clicker Fusion 2.5Fusion 2.5+ DLC
    Sleepy's Avatar
    Join Date
    Dec 2019
    Posts
    17
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    I agree that a controller is a lot more usefull ^^

    If you use an object to control sound effects you don't need to worry about remembering ^^
    It's a little harder to do but once you've done it you don't need to really worry about it ( just adding the sound effect ).
    If you need to play the same sound effect multiple time you can check which channel is currently free to use.
    Here is a little exemple of a controller that check if a current channel is free and if it is, you play a sound by a given value ( this way you can play the same sound effect multiple time without being stopped ), but, if no channel is currently free, no sound will play :

    27.PNG28.PNG

    If you have a lot of sound effect, you can deactivate every unused " Sfx xx " group of event and only re-activate the one corresponding to the current sound effect used. After calling your sound you can re-desactivate this group.

    29.png

    It seems to work fine and no sound is stopped ^^

    You can make it shorter by using Alterable Value Index and a second fast loop inside "sfx" : 30.png
    This way no need to test each channel mannually. It seems to work too ^^

    I'm not to familliar with this way of controlling sound effect since I don't mind them being stopped if the same sound effect is played twice but I hope it can be usefull and help you find a way to deal with your sound effects ^^

Similar Threads

  1. Shaders and effects for music / sound effects?
    By ratty in forum Fusion 2.5
    Replies: 0
    Last Post: 11th March 2016, 11:30 PM
  2. Shorter way for separating music and sound volume
    By kirkmet in forum Fusion 2.5
    Replies: 0
    Last Post: 18th January 2015, 03:34 AM
  3. Sound effects and Music
    By HyperspazzMan in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 5th July 2010, 04:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •