Jump to content
Mumble forums

Voice chat implementation in a C++ game


sNok3
 Share

Recommended Posts

Hi there!
As the title suggests I am trying to implement the voice chat functionality in my C++ game. However, these last few days I've been looking into possible solutions for my problem and most of them were built for game engines but that changed when I found about Mumble. However, I have found too many repos and too many links which ultimately lead to being completely overwhelmed with information and I ended up knowing nothing. My question is: how can I possibly implement Mumble to act as a client in my game and make use of its powerful positional audio? Furthermore, I am actually asking where could I see some real examples of how a voice chat implementation should look like and whether I should use Mumble Link or libmumble or the C++ plugin (and if so, how can I make it work). I know my question is confusing but I don't really know how to word it better. If something I've said isn't clear I can rephrase it. Thank you for your time!

Link to comment
Share on other sites

  • Administrators

The first question to ask yourself is whether you require the VoIP solution to be integrated into your game or whether you would be fine with users having to use the regular Mumble client for audio communications.

In the latter case, the only thing you have to do is to provide Mumble with a way of extracting player positions so that it can calculate the positional audio. For this you could either make use of the so-called Link-plugin, but a more flexible approach would be to simply write a custom Mumble plugin that communicates with your game through some means (shared memory (as Link does), sockets, ... - there are many RPC systems available, depending on your target platform(s)).

Refs for this:

 

If however, you want to embed a VoIP solution into your game, but want that VoIP to be based on the Mumble protocol, so you don't have to reinvent the wheel, you should look into libmumble (https://github.com/mumble-voip/libmumble), which implements the bare bones of the Mumble protocol. However, you'll also have to make yourself somewhat familiar with how the Mumble protocol achieves certain features that you're after (potentially useful, albeit partly outdated by now: https://mumble-protocol.readthedocs.io/en/latest/).

Note however, that libmumble is currently still somewhat early in its development and therefore there might be non-backwards compatible changes in the future, which would require you to adapt accordingly if you want to update to the latest version.

 

Does this help you?

Link to comment
Share on other sites

Indeed it helped! VoIP sounds more like it since I don't want my players to use an external client to talk so I'll take a look into your solution for sure.
I have question though: if I'm going to use libmumble, do I need to build the server with it too or can I use the existing Mumble server?
Thanks a lot for the help! From here on it should be an easy road, I hope I won't have to bother you again!

Edited by sNok3
Link to comment
Share on other sites

  • Administrators

You can simply use the official server. The Mumble protocol is open specifically for the purpose of folks being able to build their own clients and/or servers but still be able to communicate with all other Mumble clients/servers, provided everyone sticks to the protocol specs.

 

Note, that by using libmumble you will have to perform all audio processing yourself. libmumble only implements the actual Mumble protocol but things like positional audio effects are not part of the protocol (only the transmission of positional data is).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...