VBVMR General Information

How to use Voicemeeter Remote API and control Voicemeeter Audio Engine
Post Reply
Vincent Burel
Site Admin
Posts: 1399
Joined: Sun Jan 17, 2010 12:01 pm

VBVMR General Information

Post by Vincent Burel »

VoicemeeterRemote API is given by a simple standard DLL file for Windows to control Voicemeeter Audio Engine by another application, programmed in any language. It allows using voicemeeter functions and take advantage of Voicemeeter features in a client application. For example to make a more adapted user interface to a specific workflow, or to simply make a macro command to set different parameters at once, change the devices configuration and any kind of automation…

VoicemeeterRemote API also provides AUDIO API to process audio inside Voicemeeter through a simple callback mechanism.
VoicemeeterRemoteAPIs.gif
VoicemeeterRemoteAPIs.gif (48.05 KiB) Viewed 43252 times
Signal interoperability is given by existing audio interfaces (MME, KS, WASAPI, Direct-X, ASIO) and also a specific AUDIO API. Programmer can use Voicemeeter Virtual I/O to send or get Audio signal. He can also use Voicemeeter ASIO Insert Virtual Driver to process signal inside Voicemeeter Banana on all input strips.

VOICEMEETER REMOTE API SDK DIRECT LINK:
http://download.vb-audio.com/Download_C ... _Pack9.zip

Included In the VoicemeeterRemote API Package:
- VoicemeeterRemote.h (Reference ‘C’ Header file)
- VoicemeeterRemoteAPI.pdf (current documentation).

DOCUMENTATION DIRECT LINK:
http://download.vb-audio.com/Download_C ... oteAPI.pdf

- Example0: Win 32/64 bits client Application example (in ‘C’) showing the different
communication mechanisms (executable and source code).

- vmr_matrix: Win 32/64 bits client Application example of Audio Processing Object inserted
on a selected BUS to provide a 8x8 gain matrix (executable and source code).

- Some Script: different text file changing different group of parameters.

REM: VoicemeeterRemote.dll & VoicemeeterRemote64.dll are installed with Voicemeeter (in the same folder of Voicemeeter application).

Other information and example will come in this forum...
Attachments
VoicemeeterRemoteAPI2020.jpg
VoicemeeterRemoteAPI2020.jpg (260.03 KiB) Viewed 2014 times
Vincent Burel
Site Admin
Posts: 1399
Joined: Sun Jan 17, 2010 12:01 pm

Where is VoicemeeterRemote.dll ?

Post by Vincent Burel »

VoicemeeterRemote.dll is in the same direcctory of Voicemeeter (done since package 2.0.2.3).

as it is shown in the vmr_client.c source code, the VoicemeeterRemote.dll can be found by the UNINSTALLATION key in the registry:

Code: Select all

static char uninstDirKey[]="SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall";

#define INSTALLER_UNINST_KEY	"VB:Voicemeeter {17359A74-1236-5467}"

void RemoveNameInPath(char * szPath)
{
	long ll;
	ll=(long)strlen(szPath);
	while ((ll>0) && (szPath[ll]!='\\')) ll--;
	if (szPath[ll] == '\\') szPath[ll]=0;
}

#ifndef KEY_WOW64_32KEY
	#define KEY_WOW64_32KEY 0x0200
#endif

BOOL __cdecl RegistryGetVoicemeeterFolder(char * szDir)
{
	char szKey[256];
	char sss[1024];
	DWORD nnsize=1024;
	HKEY hkResult;
	LONG rep;
	DWORD pptype=REG_SZ;
	sss[0]=0;

	// build Voicemeeter uninstallation key
	strcpy(szKey,uninstDirKey);
	strcat(szKey,"\\");
	strcat(szKey,INSTALLER_UNINST_KEY);

	// open key
	rep=RegOpenKeyEx(HKEY_LOCAL_MACHINE,szKey,0, KEY_READ, &hkResult);
	if (rep != ERROR_SUCCESS)
	{
		// if not present we consider running in 64bit mode and force to read 32bit registry
		rep=RegOpenKeyEx(HKEY_LOCAL_MACHINE,szKey,0, KEY_READ | KEY_WOW64_32KEY, &hkResult); 
	}
	if (rep != ERROR_SUCCESS) return FALSE;
	// read uninstall profram path
	rep=RegQueryValueEx(hkResult,"UninstallString",0,&pptype,(unsigned char *)sss,&nnsize);
	RegCloseKey(hkResult);
	
	if (pptype != REG_SZ) return FALSE;
	if (rep != ERROR_SUCCESS) return FALSE;
	// remove name to get the path only
	RemoveNameInPath(sss);
	if (nnsize>512) nnsize=512;
	strncpy(szDir,sss,nnsize);
	
	return TRUE;
}
The Dynamic Link To VoicemeeterRemote.dll is made by the function InitializeDLLInterfaces:

Code: Select all

long InitializeDLLInterfaces(void)
{
	char szDllName[1024];
	memset(&iVMR,0,sizeof(T_VBVMR_INTERFACE));

	//get folder where is installed Voicemeeter
	if (RegistryGetVoicemeeterFolder(szDllName) == FALSE) 
	{
		// voicemeeter not installed
		return -100; 
	}
	//use right dll according O/S type
	if (sizeof(void*) == 8) strcat(szDllName,"\\VoicemeeterRemote64.dll");
	else strcat(szDllName,"\\VoicemeeterRemote.dll");
		
	// Load Dll
	G_H_Module=LoadLibrary(szDllName);
	if (G_H_Module == NULL) return -101;

	// Get function pointers
	iVMR.VBVMR_Login					=(T_VBVMR_Login)GetProcAddress(G_H_Module,"VBVMR_Login");
	iVMR.VBVMR_Logout					=(T_VBVMR_Logout)GetProcAddress(G_H_Module,"VBVMR_Logout");
	iVMR.VBVMR_RunVoicemeeter			=(T_VBVMR_RunVoicemeeter)GetProcAddress(G_H_Module,"VBVMR_RunVoicemeeter");
	iVMR.VBVMR_GetVoicemeeterType		=(T_VBVMR_GetVoicemeeterType)GetProcAddress(G_H_Module,"VBVMR_GetVoicemeeterType");
	iVMR.VBVMR_GetVoicemeeterVersion	=(T_VBVMR_GetVoicemeeterVersion)GetProcAddress(G_H_Module,"VBVMR_GetVoicemeeterVersion");
		
	iVMR.VBVMR_IsParametersDirty		=(T_VBVMR_IsParametersDirty)GetProcAddress(G_H_Module,"VBVMR_IsParametersDirty");
	iVMR.VBVMR_GetParameterFloat		=(T_VBVMR_GetParameterFloat)GetProcAddress(G_H_Module,"VBVMR_GetParameterFloat");
	iVMR.VBVMR_GetParameterStringA		=(T_VBVMR_GetParameterStringA)GetProcAddress(G_H_Module,"VBVMR_GetParameterStringA");
	iVMR.VBVMR_GetParameterStringW		=(T_VBVMR_GetParameterStringW)GetProcAddress(G_H_Module,"VBVMR_GetParameterStringW");
	iVMR.VBVMR_GetLevel					=(T_VBVMR_GetLevel)GetProcAddress(G_H_Module,"VBVMR_GetLevel");

	iVMR.VBVMR_SetParameterFloat		=(T_VBVMR_SetParameterFloat)GetProcAddress(G_H_Module,"VBVMR_SetParameterFloat");
	iVMR.VBVMR_SetParameters			=(T_VBVMR_SetParameters)GetProcAddress(G_H_Module,"VBVMR_SetParameters");
	iVMR.VBVMR_SetParametersW			=(T_VBVMR_SetParametersW)GetProcAddress(G_H_Module,"VBVMR_SetParametersW");
	iVMR.VBVMR_SetParameterStringA		=(T_VBVMR_SetParameterStringA)GetProcAddress(G_H_Module,"VBVMR_SetParameterStringA");
	iVMR.VBVMR_SetParameterStringW		=(T_VBVMR_SetParameterStringW)GetProcAddress(G_H_Module,"VBVMR_SetParameterStringW");

	iVMR.VBVMR_Output_GetDeviceNumber	=(T_VBVMR_Output_GetDeviceNumber)GetProcAddress(G_H_Module,"VBVMR_Output_GetDeviceNumber");
	iVMR.VBVMR_Output_GetDeviceDescA	=(T_VBVMR_Output_GetDeviceDescA)GetProcAddress(G_H_Module,"VBVMR_Output_GetDeviceDescA");
	iVMR.VBVMR_Output_GetDeviceDescW	=(T_VBVMR_Output_GetDeviceDescW)GetProcAddress(G_H_Module,"VBVMR_Output_GetDeviceDescW");
	iVMR.VBVMR_Input_GetDeviceNumber	=(T_VBVMR_Input_GetDeviceNumber)GetProcAddress(G_H_Module,"VBVMR_Input_GetDeviceNumber");
	iVMR.VBVMR_Input_GetDeviceDescA		=(T_VBVMR_Input_GetDeviceDescA)GetProcAddress(G_H_Module,"VBVMR_Input_GetDeviceDescA");
	iVMR.VBVMR_Input_GetDeviceDescW		=(T_VBVMR_Input_GetDeviceDescW)GetProcAddress(G_H_Module,"VBVMR_Input_GetDeviceDescW");

		
	return 0;
}
Vincent Burel
Site Admin
Posts: 1399
Joined: Sun Jan 17, 2010 12:01 pm

How to Change Voicemeeter Parameters ?

Post by Vincent Burel »

VoicemeeterRemote API allows changing parameters by simple text request

with single request function: here to mute the first strip of Voicemeeter:

Code: Select all

iVMR.VBVMR_SetParameterFloat("Strip[0].mute", 1.0f);
with script request function: to send several request in the same time:

Code: Select all

iVMR.VBVMR_SetParameters("Strip[0].gain=-30.0;Strip[0].mute=0\n"
	"Strip[1].gain=-30.0;Strip[1].mute=0\n"
	"Strip[2].gain=-30.0;Strip[2].mute=0\n");
in the VoicemeeterRemoteAPI package, vmr_client program exemple is also given with several script file to make some test, like TestStrip.txt

Strip[0].mono=0;
Strip[0].Mute=0;
Strip[0].solo=0;
Strip[0].gain=0;
Strip[0].pan_x=0;
Strip[0].pan_y=0;
Strip[0].color_x=0;
Strip[0].color_y=0;
Strip[0].fx_x=0;
Strip[0].fx_y=0;
Strip[0].comp=0;
Strip[0].gate=0;

Strip[1].mono=0;
Strip[1].Mute=0;
Strip[1].solo=0;
Strip[1].gain=0;
Strip[1].pan_x=0;
Strip[1].pan_y=0;
Strip[1].color_x=0;
Strip[1].color_y=0;
Strip[1].fx_x=0;
Strip[1].fx_y=0;
Strip[1].comp=0;
Strip[1].gate=0;

Strip[2].mono = 0;
Strip[2].Mute = 0;
Strip[2].solo= 0;
Strip[2].gain= 0;
Strip[2].pan_x= 0;
Strip[2].pan_y =0;
Strip[2].color_x= 0;
Strip[2].color_y = 0;
Strip[2].fx_x = 0;
Strip[2].fx_y = 0;
Strip[2].comp = 0;
Strip[2].gate = 0;

Strip[3].mc=0;
Strip[3].Mute=0;
Strip[3].solo=0;
Strip[3].gain=0;
Strip[3].pan_x=0;
Strip[3].pan_y=0;
Strip[3].EQgain1=0.0;
Strip[3].EQgain2=0.0;
Strip[3].EQgain3=0.0;

Strip[4].mc=0;
Strip[4].Mute=0;
Strip[4].solo=0;
Strip[4].gain=0;
Strip[4].pan_x=0;
Strip[4].pan_y=0;
Strip[4].EQgain1=0.0;
Strip[4].EQgain2=0.0;
Strip[4].EQgain3=0.0;


All requests are documented in VoicemeeterRemoteAPI.pdf
Post Reply