playMaker

Author Topic: Audio Play won't play sounds at all [SOLVED]  (Read 157 times)

Neikke

  • Junior Playmaker
  • **
  • Posts: 53
    • View Profile
Audio Play won't play sounds at all [SOLVED]
« on: October 25, 2017, 03:38:09 AM »
Hey guys, I'm really stuck here.. I just can't get Audio Play action actually play an audio (coin sound) for me.. I have Audio Source as a component on my coins - attaching inspector screenshot.

Play sound works fine but when I grab more than 2/3 coins simultaneously it gives some weird panning effects resulting in coin sound to appear only in right or left channel.. So I wanted to try Audio Play..

I tried downloading Audio Play Simple, even tried Audio Play Advanced but still - no sound on coin grab.
« Last Edit: October 25, 2017, 04:00:07 PM by Neikke »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2244
    • View Profile
    • jinxtergames
Re: Audio Play won't play sounds at all
« Reply #1 on: October 25, 2017, 12:36:20 PM »
Hi,
Can you show the audio play action.

Neikke

  • Junior Playmaker
  • **
  • Posts: 53
    • View Profile
Re: Audio Play won't play sounds at all
« Reply #2 on: October 25, 2017, 03:08:25 PM »
Sure thing - attaching
« Last Edit: October 25, 2017, 03:10:33 PM by Neikke »

Neikke

  • Junior Playmaker
  • **
  • Posts: 53
    • View Profile
Re: Audio Play won't play sounds at all
« Reply #3 on: October 25, 2017, 03:23:26 PM »
Update:

Sorry Dino, it's just me being stupid - I had Audio Source component attached to Coin, instead of Camera gameobject.. I attached it to Camera and it works now!

By the way I thought I'll end up adding a large pile of Audio Source components attached to Camera in order to play all sounds (The reason why I assign my sounds to camera is because I don't want any panning of sound from speaker to speaker as it's just a simple auto runner type of game - so I want all sounds to be centered equally.) But it turned out that it was enough to have just one Audio Source Component attached to my Main Camera and I can leave Audio Clip (in Inspector) field totally blank in there - and i still works! I assign actual sounds only in Audio Play's action itself and they just work! Is it correct or it might give some.. umm unpredictable things in build?

Thanks a lot!
« Last Edit: October 25, 2017, 04:03:32 PM by Neikke »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2244
    • View Profile
    • jinxtergames
Re: Audio Play won't play sounds at all [SOLVED]
« Reply #4 on: October 26, 2017, 09:31:18 AM »
HI,
i usually use a "Sound Manager" for 2d

Here is how i build that:
Make an empty object and call it sound manager,
Then add an audio source and and an fsm with some sounds to play
If there are many sounds i tend to group then in 2 or more child objects like on the image :



and when i need a certain sound i use "send event"

Neikke

  • Junior Playmaker
  • **
  • Posts: 53
    • View Profile
Re: Audio Play won't play sounds at all [SOLVED]
« Reply #5 on: October 27, 2017, 08:34:28 AM »
Cool! Of course now I'll do it the way you showed! But just out of curiosity, is it still kind of ok to have all those sounds being played "on" camera? The way I set it up?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2244
    • View Profile
    • jinxtergames
Re: Audio Play won't play sounds at all [SOLVED]
« Reply #6 on: October 27, 2017, 01:06:59 PM »
Hi,
I think it does not really matter if it is on a camera or another object if the sound is 2D.

But you can split up into groups (other object with a audio listener) and have a group for picking up stuff,
then another group for movement
and another one for music.
for example.

WillowN

  • Playmaker Newbie
  • *
  • Posts: 16
    • View Profile
Re: Audio Play won't play sounds at all [SOLVED]
« Reply #7 on: November 01, 2017, 09:53:00 AM »
Hi Djaydino, thanks for sharing the link for this to my other question. I am checking out this video by you https://youtu.be/eNl7ZEljcdg
One thing that would make all of this easier for me to understand would be for you to do this video again but using sounds as the context for the global variables and transitions. It's a good explanation however I feel a little lost for how to connect it to how sounds are triggered. I will dig in now but I think a really useful context for demonstrating the content in your video linked above would be how to use this for triggering sounds within your game since there are essentially no clear tutorials on that for Playmaker.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2244
    • View Profile
    • jinxtergames
Re: Audio Play won't play sounds at all [SOLVED]
« Reply #8 on: November 01, 2017, 04:06:40 PM »
Hi,
The sounds are triggered with send events from any fsm.
Like on the video on the 'Go There'
inside that state place a audio play.