# Haxe all sounds are getting played in khm/kha environment

**URL:** <https://community.haxe.org/t/haxe-all-sounds-are-getting-played-in-khm-kha-environment/4681>\
**Category:** Haxe\
**Created:** [October 1, 2025, 12:32pm UTC](https://community.haxe.org/t/haxe-all-sounds-are-getting-played-in-khm-kha-environment/4681 "2025-10-01T12:32:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sameerjan](https://avatars.discourse-cdn.com/v2/letter/s/258eb7/32.png) [@sameerjan](https://community.haxe.org/u/sameerjan)\
**Post date:** [October 1, 2025, 12:32pm UTC](https://community.haxe.org/t/haxe-all-sounds-are-getting-played-in-khm-kha-environment/4681/1 "2025-10-01T12:32:40Z")

</div>

Hi,  
In KHA/KHM Phaser environment I was adding the visibility check for the project as unity ads platform had encountered an issue. So I want to play one background music file (music.mp3). When I add a visibilitychange check to stop/resume the music, all the sounds in AudioRes start playing by themselves when the tab becomes visible again.  
What I tried:

- Used System.notifyOnPause / System.notifyOnResume.

- Added window.addEventListener(“visibilitychange”, …).

- Changed khafile.js to load only music.mp3.

- Set pauseOnBlur = false on the sound manager.

Still, every sound in AudioRes plays after focus/visibility changes, even though I only play the BGM.  
My questions are:

1. Why does AudioRes make all sounds resume?

2. Is there a way to stop this so only the BGM reacts to visibility?

Thanks!
