Application automatically stops other applications sound

I have a Player component in my application, and it stops other applications sound (such as music) even if the Player is not started. How can I fix this issue?

Please show your relevant blocks, and provide more details about what app is playing sounds.

Is this when your aia project is compiled or when using companion?

Okay, so there are two Players: one is the beginning of the music and the other one is the whole music which is set to loop.
There's a "loading screen" in the application which delays setting the canvas elements. The user can mute this music, and the previously set state of it is stored in a TinyDB. The music only starts to play, if it was not muted previously (mutesecondclick isn't 1).

The user can also change the state of the music while the game is "loading". And there's a pause button, which stops the music and starts the music.

When I started this application (it was compiled already) while I was listening to music on Spotify in the background, the music stopped, but the music of the application wasn't playing.

OK. Create an example aia project that replicates this behaviour. I suggest you just have two player components in it, to begin with, then add the procedures (that you do not show) to start and pause playback. Share that aia project here for others to test.

If you cannot replicate the behaviour in another project, then the problem exists somewhere in your blocks coding....

Okay, I could find what's the problem. If the Player is called to start somewhere in the blocks, the sound of applications are stops automatically, even if it's not called to start yet. So I cannot do anything about it.


It is probably in here:


My guess is those "delays" are not working as you expect, because you are trying to "break/cheat" the event based programming logic of AI2. This means you probably start a player without meaning to. Consider revising your blocks to remove all those delays, and use the clock timer or timers to correctly apply "delays".

To shorten it, post the aia or a small test aia.

As I said, I have found what's causing the issue. I could replicate this bug by putting a Button and making it to start a Player that has a source, and the same thing happened.

Well, I did ask previously that you create an example AIA project that replicated the behaviour, and to share it here so others could test. We have not seen this problem before...

1 Like

And as @TIMAI2 and I said, post a (small) test aia.

By the way, I'll bet you $10 that the problem doesn't exist or is fixable. :slightly_smiling_face:

1 Like