# THREE.Audio don't work on iOS

**URL:** <https://discourse.threejs.org/t/three-audio-dont-work-on-ios/34999>\
**Category:** Questions\
**Tags:** ios, audio\
**Created:** [February 17, 2022, 5:41pm UTC](https://discourse.threejs.org/t/three-audio-dont-work-on-ios/34999 "2022-02-17T17:41:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![MrMateo07](https://avatars.discourse-cdn.com/v4/letter/m/90db22/32.png) [@MrMateo07](https://discourse.threejs.org/u/MrMateo07)\
**Post date:** [February 17, 2022, 5:41pm UTC](https://discourse.threejs.org/t/three-audio-dont-work-on-ios/34999/1 "2022-02-17T17:41:52Z")

</div>

Hi everyone

I’m working on a project, it is on his final steps… but testing on devices, I noticed than Audio on iOs dont work. Neither Chrome or Safari. But Android Chrome, Safari, and desktop works perfectly.

The audio contexts is created while the page load, but is resumed when the user interacts (clic on the orange screen) that make the ambient sound play, and the other sounds plays when the ball hits the scene elements.  
All audio sources are in .mp3

Its kinda golf game. Here is a live example [https://bbc-pong.netlify.app/](https://bbc-pong.netlify.app/)

Some ideas why this is happening?

_Three r134_

---

<div class="post-metadata">

**Author:** ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)\
**Post date:** [February 17, 2022, 7:02pm UTC](https://discourse.threejs.org/t/three-audio-dont-work-on-ios/34999/2 "2022-02-17T19:02:20Z")

</div>

I’m not sure this helps but you should try to remove this warning:

> The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page.

Like mentioned in the warning you should only access the audio context _after_ a user interaction like a button press. Accessing the audio context happens as soon as you create instances of audio classes in `three.js`.

---

<div class="post-metadata">

**Author:** ![MrMateo07](https://avatars.discourse-cdn.com/v4/letter/m/90db22/32.png) [@MrMateo07](https://discourse.threejs.org/u/MrMateo07)\
**Post date:** [February 17, 2022, 7:17pm UTC](https://discourse.threejs.org/t/three-audio-dont-work-on-ios/34999/3 "2022-02-17T19:17:03Z")

</div>

I have two listeners. Wich mean two context.  
The first control the ambient sound. The second control the sound fx, bounce, hit, etc.

I modify the code, creating the first just after the user interacts with the orange overlay. And keeps without playing the ambient sound.  
Can check here, same link. [https://bbc-pong.netlify.app/](https://bbc-pong.netlify.app/)

Also check one of the examples and also dont work in iOs even having a ‘Play button’  
[https://threejs.org/examples/?q=audio#webgl\_loader\_mmd\_audio](https://threejs.org/examples/?q=audio#webgl_loader_mmd_audio)

By other wise, check this project and it works perfectly!!! (even with the console warnings)

> **[OUIGO - Let's play !](http://letsplay.ouigo.com/)**
>
> Jouez au flipper OUIGO - Let's play et tentez de battre tous les scores ! letsplay.ouigo.com

Reading documentation, to make video and audio work properly on iOs, the HTML Audio tag must have ‘playsinline’ and ‘muted’ atrributes. But how can I put it here?

Its very confussing. Any other idea?

---

<div class="post-metadata">

**Author:** ![hellogareth](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/hellogareth/32/5565_2.png) [@hellogareth](https://discourse.threejs.org/u/hellogareth)\
**Post date:** [March 18, 2022, 3:44pm UTC](https://discourse.threejs.org/t/three-audio-dont-work-on-ios/34999/4 "2022-03-18T15:44:13Z")

</div>

Hi MrMateo07. Did you find a solution to this? I’m having the same issue. I’m using MP3 and a user gesture to initialise. Thanks!
