From Mumble Wiki
Revision as of 11:57, 8 October 2007 by Slicer (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Linking a game to Mumble

The "best" way to link a game to mumble is to write your own plugin. However, that may be a lot of work, so we have an alternative method.


Somewhere in your game initalization, add these lines of code:

struct LinkedMem {
	DWORD	dwVersion;
	DWORD	dwTick;
	float	fPosition[3];
	float	fFront[3];
	float	fTop[3];

static hMapObject = NULL;
LinkedMem *lm = NULL;

void initMumble() {
	hMapObject = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, L"MumbleLink");
	if (hMapObject == NULL)

	lm = (LinkedMem *) MapViewOfFile(hMapObject, FILE_MAP_ALL_ACCESS, 0, 0, sizeof(LinkedMem));
	if (lm == NULL) {
		hMapObject = NULL;

Then, for each frame, do the following:

void updateMumble() {
	if (! lm)
	lm->dwVersion = 1;
	lm->dwTick = GetTickCount();
	// Fill lm->fPosition, fTop and fFront

fPosition should be the player position in 3D space. fTop and fFront should be the orientation.

Mumble fetches these values 50 times a second, so please update them every frame.