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

Binaural audio on positional audio #2324

Closed
lucasmr opened this issue Jun 3, 2016 · 14 comments · Fixed by #5094
Closed

Binaural audio on positional audio #2324

lucasmr opened this issue Jun 3, 2016 · 14 comments · Fixed by #5094
Labels
client feature-request This issue or PR deals with a new feature positional audio

Comments

@lucasmr
Copy link

lucasmr commented Jun 3, 2016

So, I've tested positional audio on CS:GO and Rocket League, and it seems that even after ticking the box "Headphones" on the audio setup does not correlate to binaural audio. IE: someone speaking on my left generates audio only on the left side of the headphone, instead of having a sound on both sides, but delayed ~0.7ms and attenuated on the right.

Is it working as intended, or is the feature missing?

@hacst
Copy link
Contributor

hacst commented Jun 12, 2016

Mumble's positional audio isn't true binaural audio. What we use is a simple stereo panning scheme. As such what you are experiencing is the expected behavior (though having no sound at all on the right side would require quite precise positioning). While this approach is pretty simplistic it works quite well in a lot of situations and is easy to implement and cheap w.r.t to runtime.

Of course doing something more sophisticated like a real HRTF instead would produce much more realistic results (including being able to resolve front/back as well as up/down properly). There has been some research on adding this to Mumble in the past (in the form of a research prototype and paper in Mumble 1.1.X times) but iirc the HRTF library used for that had some licensing issues and noone stepped up to further pursue the issue.

TL;DR: You could call it a missing feature ;)

@lucasmr
Copy link
Author

lucasmr commented Jun 12, 2016

Nice, thanks for the clarification.

Maybe add this as a feature request?

@davidebeatrici
Copy link
Member

@lucasmr Yes, I think it's a good idea, so we can talk about it and how to implement it, if it's possible 😉
@hacst What about OpenAL? Has it already been considered?

@hacst hacst added the feature-request This issue or PR deals with a new feature label Jun 15, 2016
@hacst
Copy link
Contributor

hacst commented Jun 15, 2016

@davidebeatrici According to Wikipedia OpenAL has a proprietary license since version 1.1 (and before that it was LGPL) which pretty much rules out using it in Mumble. There seems to be an alternative implementation https://github.com/kcat/openal-soft (did you mean that one?). However that is also LGPL which is problematic. http://www.bitoutsidethebox.com/shabda/hrtf-info/ has a description how it can be used. It also references http://recherche.ircam.fr/equipes/salles/listen/index.html as a source for HRTFs. Unfortunately I couldn't find any licensing information on those files (which doesn't necessarily mean they are restrictively licensed, we would have to find out). Licensing of the HRTFs was also a problem in the experimental implementation.

I haven't done any kind of real survey about what other implementations are out there though.

I'll see if I can dig up the old paper and code (and whether I am allowed to publish it...). If someone wants to take a stab at adding this functionality to Mumble we would definitely be willing to support such an effort.

@davidebeatrici
Copy link
Member

@hacst I checked the licenses here, I didn't know that LGPL would be a problem; I also gave a look at the one you linked.
There are some open source alternatives, such as libsoundio, but I can't find any info regarding binaural audio.
What is the old code based on?

@hacst
Copy link
Contributor

hacst commented Jun 15, 2016

Well. Qt itself is LGPL so it isn't out of the question I guess. The code was based on Mumble 1.2.2 and was likely an original implementation. I haven't found my copy yet though :( I found the paper . It's called "Integrating a HRTF-based sound synthesis system into Mumble" but it's IEEE licensed and behind a paywall (see here). I don't think I can redistribute my copy but you probably get access to it easily enough ;)

@davidebeatrici
Copy link
Member

davidebeatrici commented Jun 15, 2016

Done 😉
I see that there are a lot of interesting things in this paper 😄

@Hiradur
Copy link

Hiradur commented Jun 19, 2016

I already proposed to use OpenAL Soft in #1933.
The LGPL license of OAL Soft shouldn't be a showstopper and since it's the de facto standard for 3D audio on Linux it's well tested and in wide adoption. In the issue ticket linked above I also give some reasons why I think it's a good idea to use OAL Spft.
The information given at http://www.bitoutsidethebox.com/shabda/hrtf-info/ is outdated btw. OAL Soft now turns on HRTF automatically when headphones are detected (can be disabled in the config) and there is also an API for games to toggle HRTF.

@DaveKap
Copy link

DaveKap commented Jul 11, 2016

There are bots for Discord and Mumble which allow broadcasting of audio from sources like Soundcloud and YouTube. With Discord, stereo broadcasting works so if the source has proper left and right broadcasting, you'll hear it from the bot. Unfortunately, Mumble's bots can't broadcast this stereo yet because this feature is missing! So consider this comment a "please help me keep my friends from wanting to use Discord just because Mumble is missing this feature" vote up for adding stereo broadcasting to Mumble. ;)

@Hiradur
Copy link

Hiradur commented Jul 11, 2016

@DaveKap This issue is about binaural audio which is something different. You should create a new ticket for stereo transmissions if none exists already.

@Krzmbrzl Krzmbrzl added the client label Mar 4, 2020
Epicalert added a commit to Epicalert/mumble that referenced this issue Jun 3, 2021
There is a small time delay (interaural time delay or ITD) between your
ears depending on the sound source position on the horizontal plane and
the distance between your ears. This commit will add this delay by using
the extra sound data in the audio buffer.

For me at least, implementing this makes it much easier to identify
where a sound is coming from when positional audio is enabled.

Implements mumble-voip#2324
Epicalert added a commit to Epicalert/mumble that referenced this issue Jun 11, 2021
There is a small time delay (interaural time delay or ITD) between your
ears depending on the sound source position on the horizontal plane and
the distance between your ears. This commit will add this delay by using
the extra sound data in the audio buffer.

For me at least, implementing this makes it much easier to identify
where a sound is coming from when positional audio is enabled.

Implements mumble-voip#2324
Epicalert added a commit to Epicalert/mumble that referenced this issue Jun 14, 2021
There is a small time delay (interaural time delay or ITD) between your
ears depending on the sound source position on the horizontal plane and
the distance between your ears. This commit will add this delay by using
the extra sound data in the audio buffer.

For me at least, implementing this makes it much easier to identify
where a sound is coming from when positional audio is enabled.

Implements mumble-voip#2324
Krzmbrzl added a commit that referenced this issue Jun 14, 2021
Adds a slight delay between ears depending on where the sound source is coming from.

There is a small time delay (interaural time delay or ITD) between your
ears depending on the sound source position on the horizontal plane and
the distance between your ears. This commit will add this delay by using
the extra sound data in the audio buffer.

Fixes #2324
@foresto
Copy link

foresto commented Jun 14, 2021

The sample audio in the PR that closed this issue sounds to me not much different from panning. I guess the inter-channel delay it adds is what was originally called for here, but given that this discussion has evolved to include HRTF, would it make sense to either re-open this issue or create a new one for the more advanced functionality?

It would be impressive if mumble could do positional audio as well as I remember from Overwatch, where I could hear when someone was (for example) above and behind my left shoulder so reliably that I could swivel around to aim at them in a single motion.

@Krzmbrzl
Copy link
Member

@foresto I think a new, separate issue would be best

@foresto
Copy link

foresto commented Jun 15, 2021

Ah: I see now that #1933 covers this (although its title doesn't make it clear). I don't think we need another report for it. :)

@Krzmbrzl
Copy link
Member

Yes indeed 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client feature-request This issue or PR deals with a new feature positional audio
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants