Community Q&A

Where Wwise users help each other out!

Audiokinetic's Community Q&A is the forum where Wwise users ask and answer questions within the Wwise community. Contact Sales if your project requires a support plan.

How set a Music event to play only one time

0 votes
Hello!

Maybe is an easy problem but I have tried a lot of things and cannot resolve my problem

I have a music event that has 3 music playlist containers playing at same time. I have triggered on Unity to start when the main menu starts and its playing all the game. It is what I want. All is fine but, when go to main menu, the music starts again. Two music are playing at the same time, and three, four... every time I go to main menu. I want that only play the first one all the game, beacuse is a random infinite loop playlist.

 

Can anyone help me?

 

Thank you
asked Apr 23 in General Discussion by oscar s. (100 points)
I solved it. There is a video on the intro of APP, when it finish starts the main menu. What I did was set the event to start when the video is destroyed. It works because when you go to main menu again only a playlist is running.

I had tried a lot of things but nothing worked. I dont know why, maybe the problem was on the unity project. Thank you for your help guys!!

2 Answers

0 votes

Hello, you can go to advanced settings in property editor, set "Limit sound instances" to "1", "When limit is reached" to "Kill voice" and "When priority is equal"  to "Discard newest instance". Maybe there is another way, but that's how I do it.

https://www.audiokinetic.com/library/edge/?source=Help&id=limiting_object_playback_instances

answered May 2 by Radek Karnik (680 points)
Thanks. I tried this thing too, but, I dont know why it didnt work.
0 votes
Radek's solution will work, but if your loops overlap at all it may mess with that functionality, since the overlapping moment would be considered two instances. The alternative fix is code based - you have to set your Unity trigger to function only once, which you can do with an if statement that checks a boolean. Flip the boolean when the music triggers, and check the boolean before triggering the music. If the boolean is flipped, bypass the music trigger.
answered May 3 by Beatrix Moersch (2,360 points)
...