From Mumble Wiki
Revision as of 12:32, 28 March 2008 by Slicer (talk | contribs)
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];
	wchar_t	name[256];

static HANDLE 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;
	wcscpy_s(lm->name, 256, L"MyGameName");

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. The coordinate system is a left-handed one, and the units are in meters.

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