playMaker

Author Topic: Switching Audio Clips in real-time? No sound is playing?  (Read 1495 times)

ashulgach

  • Playmaker Newbie
  • *
  • Posts: 2
Switching Audio Clips in real-time? No sound is playing?
« on: February 27, 2018, 12:44:16 AM »
Hi everyone!

I'm having a blast using PlayMaker, but I'm encountering an issue where on the start state I have "Set Audio Loop, Set Audio Volume, Set Audio Clip" as actions, but no sound plays when I start. I placed the listener next to the object, no luck. I tried turning on "Play On Awake" and still no luck. There just isn't any sound playing. The only way a sound plays is if I set the audio clip before run time. I need it to switch clips and play those clips depending on which state is running.

Has anyone tried this or found a solution? I would greatly appreciate some help!

Thanks!

-Andrei

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Switching Audio Clips in real-time? No sound is playing?
« Reply #1 on: February 27, 2018, 01:11:42 AM »
Hi.
You need to use 'audio play' after you set the clip and leave the 'one shot clip empty'

if you want single sound (for example a jump sound) the only use a audio play and place the sound in it.
If you have multiple short sound you can make a 'sound manager' like in the picture below, each state has a different sounds.


ashulgach

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Switching Audio Clips in real-time? No sound is playing?
« Reply #2 on: February 27, 2018, 11:38:09 PM »
Hi.
You need to use 'audio play' after you set the clip and leave the 'one shot clip empty'

if you want single sound (for example a jump sound) the only use a audio play and place the sound in it.
If you have multiple short sound you can make a 'sound manager' like in the picture below, each state has a different sounds.



Thanks for the reply! That works, but it's definitely not a clean solution. Kinda tedious having to have a separate fsm just to start and stop audio when I already handle all that logic on another fsm. It would be nice for PlayMaker to have the ability to control Audio more.

The other issue is that even using Audio Play, the sounds don't loop. I have looping set to enable but I have no luck.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Switching Audio Clips in real-time? No sound is playing?
« Reply #3 on: February 28, 2018, 01:36:17 AM »
Hi.
You do not have to use a separate fsm, but for me i find this easier as it is easier to overview and easier to find and change audio files if needed.

I just tested if loop works and seems to be fine on my end. have you checked loop?

If you use a manager you can skip using "set audio clip" like on the picture.