I’m implementing the pause feature now and I have dialog in my game, which means I need to pause their sound and resume at that same point once the user continues playing again.
I cant seem to find any “pause” functionality in the documentation.
I’m implementing the pause feature now and I have dialog in my game, which means I need to pause their sound and resume at that same point once the user continues playing again.
I cant seem to find any “pause” functionality in the documentation.
On pause I use
..."set_time_step", {factor = 0, mode = 1})
to pause the time on the whole collection, but that doesn’t seem to affect sound.
I’ve created a ticket for pausing and resuming sounds: DEF-1558
So it’s not possible at all?
No, not to my knowledge. I guess you can in most cases get away with fading in/out music when you pause/resume a game.
Will you add support for pause/resume sounds? If you are, do you have a date for when it will be completed?
Jens, I’m afraid it hasn’t been given a release date yet. @Ingela_Garneij, are you able to provide an estimated release date?
Hello Jens! This feature is prioritised in our backlog and will be looked into.
Just giving a +1 on this issue. We have the same use case as @Ivan_Liljeqvist. Our levels have a time limit and we have a music score with increasing intensity as you get closer to losing the game, so pause/resume can’t really be implemented without messing up the music right now.
Hello, @britzl.
How and where I can vote up for this feature request?
I can explain my use case where I do need such a feature: I have in game music, so I’d like to pause/resume it as the user navigates between screens: game level, game over, pause screen, inventory and so on. Thanks!
I agree, this would be useful. My current approach is to set the master group gain to 0 instead, which means the CPU is still used if the sound is muted.
The reason that the speed
property isn’t possible to animate, is that wasn’t trivial to implement, since during a frame, we loop over the samples and output them. This loop is using a fixed step, but if we animate the speed, the loop steps wouldn’t be linear, and would become much more complex.
We, opted out of that for now.
We are however looking into some design issue with these properties though, and we will take a look at if we can’t add pause for a sound as well.
I see! Really tricky problem!
p.s. In as3 pause/resume functionality is implemented by PlayFrom() function. I can pass the time from what playing should start. So I stop a sound, but remember the time of playing to previousTime-variable. And when I need to resume a sound I call PlayFrom(previousTime). Not ideal, but works fine. Maybe this could help.