playMaker

Author Topic: Audio Loop  (Read 2575 times)

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Audio Loop
« on: December 28, 2015, 04:13:34 AM »
I know how to loop an audio. Just go to Audio Source and turn on the loop there, but you also need to add an audio clip. And now, to my question:

I don't want this! : I just have a simple short thruster sound to my character I want to loop. The loop doesn't work when I use the Action Audio Play and Set Audio Loop!
So, is it a way to loop an audio without setting the audio in Audio Source?
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no

SunburyStudios

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Audio Loop
« Reply #1 on: December 29, 2015, 03:02:29 PM »
Hey man, I have the same thing, a vehicle with a thruster. 

The best way I have found is to use a thruster sound that can loop without a pop or have any differentiation in volume etc.  THIS SOUND MUST BE VERY SHORT. 

Then you make an FSM and call is something like "SoundFSM"  and have the other "ControlFSM" turn the "SoundFSM" on or off.

The SoundFSM contains only two states.   Playsound+NextFrameEvent   and then it links to a  WAIT.  The WAIT then loops back to the first state.

When you click on your tiny sound file you should see more information.  This shows the EXACT length of your sound.   Simply set the wait for this length.

This should play the sound, wait for the moment it finishes, and play it again till the FSM is disabled.

This probably is not efficient at all, but it works.

 

Rabagast

  • Hero Member
  • *****
  • Posts: 683
    • Homepage
Re: Audio Loop
« Reply #2 on: December 30, 2015, 04:48:11 PM »
Hi!

I also found a way which works. Maybe it's similar to yours.

I create an empty game object with an Audio Source on it. I add the thruster sound in the AudioClip and then I check Loop. When the thruster is OFF, I deactivate the thruster sound game object. And when the thruster is ON, I activate it. Very simple, but it works! :)
Check out our homepage. http://www.walsberg.no
Or my personal game blog for news about my games. http://retro-tetro.walsberg.no