mumble-voip / mumble

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

Positional audio: round table-like arrangement #6308

Open bergfried opened 10 months ago

bergfried commented 10 months ago

Context

Using Mumble as conference software.

Description

I would like to see a positional audio plugin included in Mumble where all participants are placed as if sitting at a round table in a conference room.

That is, every user selecting it as the plugin for positional audio will be positioned at the outline of an imaginary circle with a fixed minimum distance between each other user, facing the center of the circle. Assuming alphabetical order (more specifically, the order in which users are listed in the channel overview), every user should hear the "next" user to her left, end the "previous" user to her right, implying that all user's positions are laid out clockwise in ascending alphabetical order.

This might make Mumble more appealing for serious applications like online conferences, since listening to different people from different angles might make it easier to focus on one of them (think cocktail party effect).

For demonstration purposes, please have a look at the following Python script that calculates the numbers you need to enter into the "Manual placement" plugin to get an idea of the final result.

#!/usr/bin/env python3

import sys
import math

def radius_2d(min_distance, number_of_participants):
    return min_distance / 2 / math.sin(math.pi / number_of_participants)

def ideal_position_data_2d(min_distance, number_of_participants):
    r = radius_2d(min_distance, number_of_participants)
    for i in range(number_of_participants):
        alpha = i / number_of_participants * math.tau
        yield (r * math.cos(alpha), 0.0, r * math.sin(alpha), math.degrees((-alpha + 0.5 * math.pi) % math.tau), 0.0)

def main(args):
    min_distance = float(args[1])
    context = args[2]
    participants = args[3:]
    number_of_participants = len(participants)
    for (part, pos) in zip(participants, ideal_position_data_2d(min_distance, number_of_participants)):
        print("%15s:  X=% .2f  Y=% .2f  Z=% .2f  azimuth=%3d  elevation=%d  context=%s  identity=%s" % \
            (part, round(pos[0], 2), round(pos[1], 2), round(pos[2], 2), round(pos[3], 0), round(pos[4], 0), context, part))

if __name__ == "__main__":
    main(sys.argv)

For example, if you call it like this …

./demo.py 1.5 rdtbl Alice Bob Chuck

… and Alice, Bob and Chuck enter the numbers as computed for each of them, ideally, they should hear each other as if sitting at a round table, with at least 1.5 meters between each of them.

Bonus points if priority speakers are placed as if floating, talking down from above the center of the imaginary table.

(Actually, I am not sure whether I got the computation right, but it should be enough to get the idea.)

Mumble component

Both

OS-specific?

No

Additional information

Note that I did not try to write such a dedicated plugin myself for various reasons, but especially because I cannot remember the plugin API exposing all of the relevant data (especially the list of all user's names in the same context) for this kind of plugin to be be written as a "normal" positional audio plugin. Besides, having such a plugin built into every Mumble client by default would make adoption much better, maybe even giving Mumble a feature to distinguish it from other, less privacy-oriented conference software.

Krzmbrzl commented 10 months ago

More generally, this kind of thing would probably also benefit of introducing a local-only positional audio where not every client has to enable it in order for things to work. Instead, users could simply place other clients spatially as desired and have positional audio work regardless of whether or not the other participants use it. E.g. like the manual plugin but instead of only placing yourself, you place everyone.

Arranging folks equidistantly around a circle would then simply be a convenience feature.

One would have to ensure however, that folks won't end up being muted by positional audio (at least not accidentally) as this is likely not what would be desired in such non-gaming related scenarios.

Akasen commented 5 months ago

So I'm gonna put my two cents on this and say that this would be an extremely interesting feature for something like playing TTRPG's online.

I think a feature like this, or just an all around overhaul to the manual position plugin and its documentation, would be appreciated.