0
Answered

sound / volume

Alienmadness 2 months ago in Game Creator updated by Marti (Lead Developer) 2 months ago 1

Any way to set the volume for an individual sound via the Play sound action?  i may have a few different sounds in the scene, and would like them at different volumes.  Using the Play Sound doesn't allow for a volume modifier.  any suggestions?

or anyway to execute a AudioSource to the Play Sound via the audio manager?

Unity version:
unity 2019.3
Game Creator version:
1.0.2

Answer

Answer
Answered

Hi Alienmadness. The Play Sound, as you mention, doesn't allow to change the volume of that particular sound. This should be ideally done in an external program and import the sound effect with the correct volume. The reason being that we have a separate volume layer for different kind of audios:

  • Music
  • Sound Effects
  • Voices (coming soon)

However, if you still want to play a sound and modify its volume from Unity, as you said, you can do that interacting with the AudioSource component. You just need to enable the "Play On Awake" option in that component. To play this AudioSource component, disable and enable it using the "Set Active" action.

Hope this helps! Happy game making!

BAD, I'M UNSATISFIED

The 1st solution isnt really very efficient. if i make a sound file different volumes for each instance i need to use it, i could have 3 or 4 of the same audio files just at different volumes, which is very inefficient and increases the game size during build.

I like the Audio Source option, but i would need a way to assign a Audio Source to the Music or Sounds layer. I see a Play AudioSource Action on the Hub. but it doesnt have a way to assign it to the music or sounds layer.  I want the audio im using to be effected by the Sound and Music sliders i have setup in the options menu.

Satisfaction mark by Alienmadness 2 months ago
Answer
Answered

Hi Alienmadness. The Play Sound, as you mention, doesn't allow to change the volume of that particular sound. This should be ideally done in an external program and import the sound effect with the correct volume. The reason being that we have a separate volume layer for different kind of audios:

  • Music
  • Sound Effects
  • Voices (coming soon)

However, if you still want to play a sound and modify its volume from Unity, as you said, you can do that interacting with the AudioSource component. You just need to enable the "Play On Awake" option in that component. To play this AudioSource component, disable and enable it using the "Set Active" action.

Hope this helps! Happy game making!