# Overlapping audio files?

**URL:** <https://phaser.discourse.group/t/overlapping-audio-files/11310>\
**Category:** Phaser 3\
**Created:** [February 26, 2022, 4:08pm UTC](https://phaser.discourse.group/t/overlapping-audio-files/11310 "2022-02-26T16:08:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joydurn](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/joydurn/32/6259_2.png) [@Joydurn](https://phaser.discourse.group/u/Joydurn)\
**Post date:** [February 26, 2022, 4:08pm UTC](https://phaser.discourse.group/t/overlapping-audio-files/11310/1 "2022-02-26T16:08:18Z")

</div>

Couldn’t find much on this, pretty simple question. I want to play a sound when user presses a key, but i want the sound to overlap itself if pressed multiple times. How do i do this? Right now, I have it so that when u press the key while the sound is playing, the sound just restarts. (i.e sound stops playing, then starts from the beginning)

[Overlapping SoundFX get cut off. · Issue #1220 · photonstorm/phaser · GitHub](https://github.com/photonstorm/phaser/issues/1220) I found this thread covering the same thing but I believe its outdated, the sound.allowMultiple flag mentioned there does not seem to be working for me? I’m still a novice so I could just be doing it wrong, would love to know.

Heres basically an example of what I have right now (preload and input is settled already)

sound=this.sound.add(‘sound1’,{volume: 0.4})  
//tap W for sound  
keyW.on(‘down’, function(event) {  
sound.play();  
})

any help appreciated

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [February 26, 2022, 4:12pm UTC](https://phaser.discourse.group/t/overlapping-audio-files/11310/2 "2022-02-26T16:12:23Z")

</div>

👋

The simplest way to do this is to change to

```
this.sound.play('sound1', { volume: 0.4 });
```

---

<div class="post-metadata">

**Author:** ![Joydurn](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/joydurn/32/6259_2.png) [@Joydurn](https://phaser.discourse.group/u/Joydurn)\
**Post date:** [February 28, 2022, 5:19pm UTC](https://phaser.discourse.group/t/overlapping-audio-files/11310/3 "2022-02-28T17:19:44Z")

</div>

hi thanks for the solution! this does indeed work for making the sounds overlap! because it was in the key.on() function i had to change it to gameScene.sound.play, but it worked! Thanks!
