I will describe the problem in 2 words, maybe it came across.
On the computer, when the test is working, I click on the button, switch to another layout and the sound is turned off, I return to the previous layout and the sound does not play - so it should be.
When I import to iPhone via XCode, when I press the button and switch to another layout, the sound is turned off, but when I return it continues to play.
So it’s not as long as I’ve forcibly set the mute off.
The code works as it should, and in the test everything is fine. What is the problem exactly on the iPhone.
And the sound ignores the variable - that is, it cannot play if the variable is equal to 1.
When testing for iPhone, the variable does not change, the sound plays, when the variable 0, the sound plays and then it turns out that it is reset