Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should we add a warning for positional audio usage for iOS? #3435

Open
yaustar opened this issue Aug 31, 2021 · 9 comments
Open

Should we add a warning for positional audio usage for iOS? #3435

yaustar opened this issue Aug 31, 2021 · 9 comments
Labels

Comments

@yaustar
Copy link
Contributor

yaustar commented Aug 31, 2021

Due to this issue on Webkit, positional audio usage on iOS causes the sound to be corrupt after a few minutes of play.

#2866

As it's an issue that affects every project on Webkit that uses positional, it's been suggested that we should add a warning 'somewhere' to advise users.

Suggestions have been:

  • Directly in the Editor inspector
  • A warning at the engine level
  • In the user manual so it's easily searchable

A couple of things to consider.

  • It's not easy to find all entities that have a specific component (yet) so having to go back retroactively and find all the entities can be time consuming.
  • The default setting for adding a sound component is to be positional (maybe this should be changed?)
  • Is it a good UX experience to encounter the issue after making the project with positional audio only to run into the issue, find it in the manual and go back to retroactively fix it?
@leonidaspir
Copy link
Contributor

We are getting audio glitches with positional sounds, not only on iOS and not after some time but directly as soon as the app starts, on Chrome (92.0.4515.159)/Windows.

Do you think it's related?

Positional_audio.mp4

@leonidaspir
Copy link
Contributor

Issue persists when updating to Chrome latest version: 93.0.4577.63

We've tried a random WebGL example that uses spatial audio, no glitches there:
https://threejs.org/examples/#webaudio_orientation

In our PlayCanvas project we've tried both with compressed (mp3) and uncompressed (wav) audio files, it didn't make any difference.

@yaustar
Copy link
Contributor Author

yaustar commented Sep 6, 2021

What kind of glitches am I listening out for? Static at the 3 sec mark?

@leonidaspir
Copy link
Contributor

Yes, static from time to time. Still researching if it's specific to this machine or not, though on the Three.js example always works fine.

@LeXXik
Copy link
Contributor

LeXXik commented Sep 6, 2021

To add here - I tried various audio formats/codecs and also recorded audio at different bitrates - none helped, so it must be something else. A quick look on the three sources, they use a different panning model - HRTF:
https://github.com/mrdoob/three.js/blob/342946c8392639028da439b6dc0597e58209c696/src/audio/PositionalAudio.js#L17

And PC is not setting a panning model, which defaults it to equalpower setting (less quality, higher efficiency). Perhaps this could be tried out.

@LeXXik
Copy link
Contributor

LeXXik commented Sep 6, 2021

I tested the HRTF mode and it didn't help. The sound changed, but the static is still there.

2021-09-06.22-17-23.mp4

@LeXXik
Copy link
Contributor

LeXXik commented Sep 6, 2021

There is a Chrome bug. Firefox affected too:

https://bugs.chromium.org/p/chromium/issues/detail?id=1242647

@vkalpias
Copy link
Contributor

Issue persists when updating to Chrome latest version: 93.0.4577.63

We've tried a random WebGL example that uses spatial audio, no glitches there:
https://threejs.org/examples/#webaudio_orientation

In our PlayCanvas project we've tried both with compressed (mp3) and uncompressed (wav) audio files, it didn't make any difference.

I tried downloading the Threejs example and changed the sound to the engine sound that we have in our example. If I move closer to the audiosource I can hear crackling there too... And when I tried the original sound from threejs's example in PlayCanvas I didn't notice crackling.

@yaustar
Copy link
Contributor Author

yaustar commented Jan 10, 2023

I found a related issue in Howler.js which points to different sample rates being used the potentially cause of the issue goldfire/howler.js#1141 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants