playMaker

Author Topic: random sound volume  (Read 1381 times)

IIKII

  • Full Member
  • ***
  • Posts: 137
  • Lonely developer
    • Patreon
random sound volume
« on: December 06, 2016, 09:16:19 AM »
Hi, the volume with play random sound is too low. I try setting audio volume as well as add audio source but it's not working.

I am aware of play audio advance action but I want to use the random sound action.

How to fix the volume issue?
Support me on Patreon for free adventure games and development insights - https://www.patreon.com/koexstudio

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: random sound volume
« Reply #1 on: December 06, 2016, 02:49:15 PM »
Hi,
To do random sound i usually do this with arrays and audio play

So i have my audio into an array (sounds) and i use 'array get random indexed'
(this is a custom action i made, because the standard 'array get random' is not storing the index number) and store the sound and the index nr.

Then i have another array (Volume) with a float value for the volume for each sound.
and i get the volume with 'array get' and use the index number.
Then i use audio play with the sound and volume variables.

If you don't need separate volumes you can just use one array (sounds)

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: random sound volume
« Reply #2 on: December 06, 2016, 02:53:46 PM »
The Custom Action you can find on the Ecosystem btw :)