Forum rules - please read before posting.

Can not play 2 sounds at the same time?

edited January 2016 in Technical Q&A
 Why I'm not able to use action Sound: Play to play 2 different sounds at the same time?
In my interaction I have 2 actions Sound: Play one after another and only the last one plays?
 Both sound objects are prefabed and in the resource folder with RememberSound components attached and different ID's. No errors.
And I use it to play music, I have both Sound type : Music and it looks like this is the problem, if I switch to SFX both play.
Is this a bug?

I need this for my music list that I set up and I need to launch all music at once and turn down the volume in order it to work correctly.

AC 1.50b Unity 5.2.4f1
Thanks

Comments

  • Are both Sound objects present in the scene?  Check that the first plays if you disable the second Action.
  • edited January 2016
    Both are created by an asset action list and yeah, both are present.
    The first does play if I disable the second.
    But if I have two three or more it always plays the last one.
    As I mention this only happens when I use Sound type: Music but it works if I use Sound type: SFX.
    But it would be wrong to use SFX instead of Music since the volume control/adjustment in the game is different.
  • Music is a special-case type because it is assumed that only one is played at a time.
  • If you want to prevent this, duplicate ActionSound and give it a new title/description, and remove lines 84-91.  You can then use this new Action instead to play music without affecting existing tracks.
  • edited January 2016
    That confirms my suspicions. Can this issue be addressed somehow?
    With out it I have a big problem with my music not being played after game is loaded.

    I have made a nice AC actionlist based Music system that runs my music files in order one after another.
    I set exactly the number or seconds for each song and tick it down to zero each time action moves to the new song. And it works great with RememberSound too, since the ticks are saved as variables.
    And upon loading a game the music plays  from where it was saved.

    However If I completely quit the game and launch it, then when I load my saves there is no music being played, that's because. RememberSound needs that exact file that was playing to be played in order to proceed and play from where it was left.
    And since I have many songs I need them all to be played with Sound: Play , and when the game loads RememberSound finds the exact song and plays on. (Of course I turn down the volume on other songs that are not being played and stop them)

    I've tested it on the single songs, but it doesn't work if I try to play all of them, thus I was asking about why cant we play 2 Sound: Play together.

    Could Sound type: Music work like SFX type?
  • Ok I'll give it a try, thanks a lot for your help as usual.
  • edited January 2016
    Your suggestion helped.
    But I'm still having some troubles. Though I can load from anywhere and the music continues playing from where it  was saved. It doens't continue after I load another different save where  2nd song started when I saved it.

    How does this RememberSound work?
    Is there any way to check if the sound is playing and fire RememberSound to continue playing from where it remembered?

    Or if you have any idea how to set up music play file after file and remember the state so the saves could be loaded and the music would play from where it remembered?

    Thanks for any input.
  • Is there any way to check if the sound is playing and fire RememberSound to continue playing from where it remembered?

    Well, that's exactly what it's supposed to do.  But again, AC assumes that only one's playing at a time.  Check that you can have a single track restore properly first.  It may be that you instead have to set your Sound type to Other and connect the volume to your Music volume manually.
  • edited January 2016
    No, it won't continue playing when you load your save where the second song started and the game was saved. I guess it keeps looking for the first song. Here is the asset actionlist set up that I fire OnLoad cutscene:
    http://postimg.org/image/i7timg06z/full/
    http://s9.postimg.org/zcfvm8ef3/Capture.jpg

    Is there a way to tell RememberSound to look for another (or specific) song?

    Having just one song being played the whole game will drive people nuts :)

  • RememberSound does not act aware of any other Sound object, only the one it is attached to.  Are you looking to queue your music, or play multiple tracks at the same time?
  • Just queue my misic files and when I save, and then load the game, the load should continue playing from whatever song and song's track position it was saved.
    I'm open to any suggestion. :)
  • edited January 2016
    Ok, I sort of solved the problem.
    I added some checks on my onload music assets that check for variables for more and less, and check each song and if they meet I just fiire the song that meets from the start.
     So basically now it is not played from the exact position where it was saved but rather from the start of that song that was playing, which is a good way around the problem :)

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.