Does sound.play/stop is executed during world pause?

Hi! Basically the question is already in this topic name.
For example, I have level world and options popup, before showing options popup I pause level with

msg.post('#collectionproxy', "set_time_step", { factor = factor, mode = 1 })

After that I would like to control sound of the level world in options popup using post.msg(‘stop_music’) to the level.
But seems that it message queue is not executed during world is on pause and messages are just added to the queue, but not executed. Can somebody please tell, do I correct understand how it works and what solution can be applied? :slight_smile:

Kalispera @ItsPixel I think you could try send the message right before the pause world. And after disable pause and disable popup to enable again sound with play. Thanks

Yes I believe this is the expected behaviour. @JCash can you confirm? A solution would be to have the music in another collection.

By looking at the code in gameobject.cpp (called from comp_collection_proxy.cpp), I see no check to see if the collection (proxy) is paused, so I assume the messages are being sent.

Perhaps you can provide us with a small repro case project?

We put our audio/sound components into a single collection within the main bootstrap collection so they can be managed regardless of the state of an individual screen. Centralizing it also helps with situations like audio gating.

2 Likes

I didn’t read the issue properly. I thought it was the sound that paused when the timestep was 0 (and I’m not sure if this happens or not). But messages should be delivered to a collection even if the timestep is 0.

I was also curious about this. I made a test project to confirm, and messages are indeed still coming through: MessagePassingToPausedCollection.zip (24.2 KB)

1 Like

Created a small repo case project and found that it works fine without any issues. Sorry for disturbance, will try to search what is wrong with my code.

5 Likes