# Positional audio for mobile devices (earphones)

**URL:** <https://discourse.threejs.org/t/positional-audio-for-mobile-devices-earphones/5203>\
**Category:** Questions\
**Tags:** audio\
**Created:** [December 1, 2018, 4:33pm UTC](https://discourse.threejs.org/t/positional-audio-for-mobile-devices-earphones/5203 "2018-12-01T16:33:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![KimGoji](https://avatars.discourse-cdn.com/v4/letter/k/7ab992/32.png) [@KimGoji](https://discourse.threejs.org/u/KimGoji)\
**Post date:** [December 1, 2018, 4:33pm UTC](https://discourse.threejs.org/t/positional-audio-for-mobile-devices-earphones/5203/1 "2018-12-01T16:33:39Z")

</div>

Hi all,

I’m fairly new to Three.js so I apologise for perhaps raising a question that has been already answered and/or if the solution does not exist for obvious reasons that beginner level developers just dont know. Yet.

So basically I’m trying to make this …

[https://threejs.org/examples/#webaudio\_orientation](https://threejs.org/examples/#webaudio_orientation)  
[https://threejs.org/examples/#webaudio\_sandbox](https://threejs.org/examples/#webaudio_sandbox)

… as a website but explicitly for mobile.

I want to create a landscape of video-objects that can be found through audible hints. However, none of the abovementioned examples seem to work on the phone.

Does someone know if it is even plausible, given that earphones would be required from the user?

Thank you in advance!

Kim

---

<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:** [December 1, 2018, 5:59pm UTC](https://discourse.threejs.org/t/positional-audio-for-mobile-devices-earphones/5203/2 "2018-12-01T17:59:52Z")

</div>

The sandbox example works on my Pixel (1) with Chrome. The `webaudio_orientation` actually has an issue since `play()` is called too late which causes the following security error:

> Uncaught (in promise) DOMException: play() can only be initiated by a user gesture

I’m making a PR to fix this problem.

> <https://github.com/mrdoob/three.js/pull/15353>
>
> Fixes a problem with Chrome mobile. The following error is currently produces si…nce \`play()\` is called too late:
> 
> \> Uncaught (in promise) DOMException: play() can only be initiated by a user gesture

---

<div class="post-metadata">

**Author:** ![KimGoji](https://avatars.discourse-cdn.com/v4/letter/k/7ab992/32.png) [@KimGoji](https://discourse.threejs.org/u/KimGoji)\
**Post date:** [December 1, 2018, 8:40pm UTC](https://discourse.threejs.org/t/positional-audio-for-mobile-devices-earphones/5203/3 "2018-12-01T20:40:28Z")

</div>

My hope is to make something for a large audience, making chrome dependency definitely an issue. Basically it needs to run on most devices both iOs and Android, on safari and chrome.

Do you think its doable?

---

<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:** [December 1, 2018, 8:47pm UTC](https://discourse.threejs.org/t/positional-audio-for-mobile-devices-earphones/5203/4 "2018-12-01T20:47:45Z")

</div>

> [@KimGoji](#):
>
> Do you think its doable?

I’m not sure about this. The robustness of such an app does not only depend on `three.js`. If the app is going to be very complex, there might be browser issues which can only be resolved if bugs are properly filed at the respective trackers. `three.js` is only a thin layer over the Web Audio API. This is something you should keep in mind.
