Skip to content

3D spatialization is unsuitable for games -> quick position updates lead to crackling #130

Open
@m-rei

Description

@m-rei

What information was incorrect, unhelpful, or incomplete?

https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API/Web_audio_spatialization_basics
makes this statement:

As if its extensive variety of sound processing (and other) options wasn't enough, the Web Audio API also includes facilities to allow you to emulate the difference in sound as a listener moves around a sound source, for example panning as you move around a sound source inside a 3D game. The official term for this is spatialization, and this article will cover the basics of how to implement such a system.

which is wrong.
it does NOT provide a way to properly apply it for 3D games.

What did you expect to see?

An audio system suitable for games: no crackling when position is updated quickly.
When a space ship with engine sound moves very quickly from left to right, you hear crackling.

Perhaps its skill issue on my part and i'm overlooking something, but its a very basic use case.
Even trying something like exponentialRampToValueAtTime does not help.
I think i understand the underlying issue: crackling happens when an abrupt jump occurs in the graph if the sound was plotted. I have no means or solution with the given tools (in the browser) to solve this issue.

I expect from "3d spatialisation" system to already account for that and have things in place so that the API consumer does not have to deal with it themselves.

Do you have any supporting links, references, or citations?

https://mdn.github.io/webaudio-examples/spatialization/

buggy:

  1. go to link
  2. press play
  3. press and hold right rotation and observe the crackling

in this demo the movement is too slow to reproduce the crackling issue, but it can be done with rotation.

Do you have anything more you want to share?

Please fix or provide a way for audio novices to effectively use it.

I have tried PannerNode and StereoPannerNode to no avail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageTriage needed by staff and/or partners. Automatically applied when an issue is opened.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions