playMaker

Author Topic: [Solved] I need a sound to loop AND be able to adjust its volume.  (Read 3676 times)

createasaurus

  • Full Member
  • ***
  • Posts: 146
[Edit - please skip all the way down to the next post.  I rewrote my question to be more clear.  Thank you.]

I am trying to adjust the volume of a looping audio clip during the game.  I think I'm doing things correctly... but it is not working.  Maybe I am overlooking something?  Here is how I set it up:

I have a game object, called MusicPlayer, with an audio source.  It has the following actions:
1) Set Audio Clip
2) Set Audio Loop (I have loop checked)
3) Audio Play (Game Object is Owner), Volume is 1

A different FSM sends the following:
4.) Set Audio Volume (I specify game object as MusicPlayer)

No matter what I set the Set Audio Volume at... it has no effect.  It continues to play and loop at full volume.

Any thoughts are appreciated.

Thank you,
createasaurus

[Update]  When I use "one shot play" within Audio Play, it works... but, I need it to loop... so I don't think I can use one shot?  The funny thing is, when I read the program notes in Audio Play, it says that volume cannot be adjusted when using one shot.  However, the exact opposite seems to be happening to me. I am able to adjust volume with one shot, yet I am not able to adjust volume with standard Audio Play.  Thoughts?  Thank you.
« Last Edit: May 14, 2015, 12:00:39 PM by createasaurus »

createasaurus

  • Full Member
  • ***
  • Posts: 146
Re: Set Audio Volume - I can't get it to work.
« Reply #1 on: May 13, 2015, 03:58:02 AM »
OK, I'm rewriting my original question here to be more clear.

I need to have a looping sound that I can adjust the volume of.  However...

When I use Audio Play / One Shot Clip... I can adjust volume, but no looping.
When I use Set Audio Clip, Audio Play... I can loop, but not adjust volume.

Please advise on how to have a sound that I can both loop and adjust volume of.

Thank you!
« Last Edit: May 13, 2015, 12:06:43 PM by createasaurus »

createasaurus

  • Full Member
  • ***
  • Posts: 146
Respectfully, I need to bump this.  Please understand.  Thank you.

Bottom line: I need a sound to loop AND be able to adjust its volume.  Can this be done?

With appreciation and gratefulness,
Thank you,
createasaurus

600

  • Moderator
  • Hero Member
  • *****
  • Posts: 727
    • 600
Hi,

had some troubles with this too,
here is basic setup on empty game object, see attached image.
When in Game mode, use volume slider to test it.


createasaurus

  • Full Member
  • ***
  • Posts: 146
THANK YOU 600!!!!!!!!!!!!!!!!!!!!!!

It works!!!  It works!!!  Ahhh days of going around in circles...

It was your picture... I saw you had every frame checked! I was not doing this.  My project was set up to leave the Set Volume state immediately.  I've now rewritten it to have a state just sit there repeatedly executing the current volume level.

This was counter intuitive to me to need every frame... so I may not have found it otherwise.

Thank you again!
createaseurus

tyrot

  • Playmaker Newbie
  • *
  • Posts: 17
Re: [Solved] I need a sound to loop AND be able to adjust its volume.
« Reply #5 on: June 16, 2016, 02:13:31 PM »
sometimes a PNG saves you from insanity (even after 1 year) .. thanks 600 !