mumble-voip / mumble

Mumble is an open-source, low-latency, high quality voice chat software.
https://www.mumble.info
Other
6.13k stars 1.1k forks source link

Use non-environmental physics for positional audio? (Doppler, phase) #5934

Open will-ca opened 1 year ago

will-ca commented 1 year ago

Context

No response

Description

Note: #3234 seems to primarily be about using game map data to simulate evironmental effects like occlusion, attenuation, and reverb, requiring deeper app integration. This is specifically about effects that do not require any more information than should already be available, so I'm opening a new issue.

Phase shift is very important for audio localization, as differences in volume aren't always that great, especially for far-away sources:

https://en.wikipedia.org/wiki/Sound_localization

However, web search shows that this has apparently never been discussed in connection with Mumble.

https://www.google.com/search?hl=en&q=%22mumble%22%20voip%20%22phase%22

On a technical basis, this should be pretty straightforward. Find the difference in distance between the two ears, divide by the speed of sound, and delay one channel by that much.

EDIT: Already implemented in #5094.

Doppler is less universally important, but could be cool in certain settings.

If it can be broken into chunks, it can be as simple as speeding up or slowing down playback. If not, I suppose it can probably be resampled continuously.


Phase shift only requires positioning/orientation, which are presumably already required anyway.

Doppler requires speed, which can be computed from position changes.

Both doppler and phase shift would organically emerge from simulating speed of sound per ear.

Mumble component

Client

OS-specific?

No

Additional information

See also: #1933

Krzmbrzl commented 1 year ago

Find the difference in distance between the two ears, divide by the speed of sound, and delay one channel by that much.

That's already implemented via https://github.com/mumble-voip/mumble/pull/5094 (if I understood you correctly)

will-ca commented 1 year ago

That's already implemented via #5094 (if I understood you correctly)

I suppose it is. I did not find it as it used different terminology, but that is the same phenomenon.