I haven't updated the AC core in a while (about a year) so, when I finally did (now I'm using 1.56g), I went through my game to hunt for bugs that would come up and found a "nasty" one.
In my game I have a constantly looping background sound, stored into a specific GameObject that will also play across scenes.
In my Inspector I noticed that whenever the first Speech line has appeared on screen (I only have subtitles, no voiceovers) the Volume bar of the AudioSource slides all the way left, while the value increases and decreases randomly for a few seconds before stopping in a similar fashion as per the image that follows:
Also, it becomes stuck in that position.
Things I tried (one at a time):
- I have browsed through the ActionLists and apparently none of them would
interfere with that specific GameObject at that moment in the game. And
all those that do later on are anyway changing the relative volume to
1.
- By default, my Scene didn't have a "Default Sound", so I gave it one.
- I tried commenting my own scripts that would involve audio manipulation.
Nothing changed, apparently.
Therefore I'm suspecting it is something linked to the Speech "system" itself, but I'm clueless at the moment on how to address the issue.
Does anybody know where should I look for a solution?
Thanks in advance!
Comments
To test it further I forced the speech to be display forever until skipped and I can confirm that the background sound would work until the first line of speech in the game has been skipped.
I used to have 3 sound files that would randomly play through this
GameObject (named BGMusic). Its logic is ruled by a specific ActionList
and, even in this case, there is nothing that seems to relate to volume
reduction
Which Unity version, and are you relying on Audio Mixer Groups? Please try to provide some steps that can be followed to recreate this issue
---
Apologies for the lack of information provided. Please, tell me if I missed anything!
I'm using the latest Unity version (5.6.0f3) with Adventure Creator 1.56g. I can't really tell which Unity version I upgraded from (I'm pretty sure that it was still in the 5.x.x, though), but the last Adventure Creator version I used to build the game was 1.49.
By "background sound would work" I meant that it would work correctly until the first line of speech goes out of the screen, no matter if I set speech to disappear after few seconds or if I set it to be only skippable by the player.
So, sound works as long as it does not appear in the first place and, once appeared, for as long as the speech remains on screen. After it disappears, the sound stops and the "gauge" acts as I described in the my original post.
Unless I have a really bad memory about it, I should have never used Audio Mixer Groups. I thought that maybe something in that regard had appened because of the upgrades but, as far as I can tell, no Audio Mixer Groups is in place (all the Outputs of the Audio Source components I have are set to "None").
Now some good news: up until now I was using three different Sound types (as listed in the Sound script in Adventure Creator) and just now, tweaking them, I can make things work.
Not sure why, though, so I will share this in case you may have more insight.
Up until now I had:
- The always-looping background sound (GameObject named SeaBackground)stored in the "Other" Sound type.
- The background music (GameObject named BGMusic) described in my last post in the "Music" Sound type
- Various sound effects triggered during the game (the default AC's Sound prefab) in the "SFX" Sound type.
Now I switched SeaBackground in the SFX Sound type and neither SeaBackground nor BGMusic stop anymore. So as far as I can tell it should be kinda fixed (I hope to confirm this as I tweak further), even though I don't really know why it all happened in the first placeI hope I haven't missed anything!
Still, thanks a lot for your support!!
You should move your music to the new music system, which allows for better control when working across multiple scenes - see the new Sound: Play music Action.