Control VoiceMeeter API from Python

The Virtual Audio Mixer discussions and support...
Post Reply
JanF_04
Posts: 1
Joined: Fri Sep 18, 2020 11:08 pm

Control VoiceMeeter API from Python

Post by JanF_04 »

Hello together,

since I use Voicemeeter Banana, I wanted it to be interactive with my arduino. That means I also want to get a feedback. For this I have to use the Voicemeeter API and not only some MIDI signals.
Does anyone know how to call the API from Python, because i never programmed sth. in C# or C++.

Thanks for helping
Jan
sjc-or
Posts: 25
Joined: Sun Sep 06, 2020 11:17 pm

Re: Control VoiceMeeter API from Python

Post by sjc-or »

No but I'm working on something in AutoHotKey. I've been able to successfully:
  • Capture the state of all buttons and updating my MIDI controller. If you change a button on the screen it updates my controller and visa versa.
  • Program the MONO buttons without using Macros. (Voicemeeter doesn't have mapping for these)
Here is a link to the API wrapper for Voicemeeter. For MIDI in and out I had to build my own AHK script (with the help from many sources from the AHK forum)

https://github.com/SaifAqqad/VMR.ahk
sjc-or
Posts: 25
Joined: Sun Sep 06, 2020 11:17 pm

Re: Control VoiceMeeter API from Python

Post by sjc-or »

JanF_04 wrote: Sat Sep 26, 2020 11:15 am Hello together,

since I use Voicemeeter Banana, I wanted it to be interactive with my arduino. That means I also want to get a feedback. For this I have to use the Voicemeeter API and not only some MIDI signals.
Does anyone know how to call the API from Python, because i never programmed sth. in C# or C++.

Thanks for helping
Jan
Hi,

I haven't done Python yet, but I put together a very basic test using VisualStudio 2019 C++. Just Login() and Logout() are currently implemented.
This is actually my first crack at CPP. so it is very basic but maybe it will help you.

Code: Select all

/* VMR-Login/Logout Test
2020-10-15 - Steven J. Caldwell
This is a console based application written with C++ Visual Studio 19 in console mode just to test a few 
API functions of Voicemeeter Remote
*/

#include <iostream> // Not sure if this is needed in this app
#include "windows.h"
#include <string>
#include <chrono> // used for Sleep function
using namespace std;


typedef HRESULT(CALLBACK* LPFNDLLFUNC1)();

class Vmr {
    public:
        string bus[8];
        string strip[8];
        Vmr()
        {
            HINSTANCE hDLL;
			// For the 32 bit version
            hDLL = LoadLibrary("C:\\Program Files (x86)\\VB\\Voicemeeter\\VoicemeeterRemote.dll");
            if (hDLL != 0)
            {
                // set up pointers
                cout << "Set up Pointers\n";
                cout << "Vmr DLLL=" << hDLL << '\n';
                VbVMR vBvmr(hDLL);
            }
            else
            {
                // report DLL load error
                cout << "Cannot Load DLL\n";
            }
            // cout << "Hello World!";
        }
        class VbVMR {
        public:
       LPFNDLLFUNC1 login;
       LPFNDLLFUNC1 logout;
       HRESULT hrReturnVal = 0;
       VbVMR(HINSTANCE hDLL)
                {
      
                  //  HINSTANCE myHDLL;
                  //  myHDLL = hDLL;
                    cout << "VbVMRhDLL=" << hDLL << '\n';
                    login = (LPFNDLLFUNC1)GetProcAddress(hDLL, "VBVMR_Login");
                        if (login != 0)
                        {
                            cout << "Login Success:login=" << login << '\n';
                        }
                        else
                        {
                            cout << "Login Failure:login=" << login << '\n';
                        }
                    logout = (LPFNDLLFUNC1)GetProcAddress(hDLL, "VBVMR_Logout");
                        if (logout != 0)
                        {
                            cout << "Logout Success:logout=" << logout << '\n';
                        }
                        else
                        {
                            cout << "Logout Failure:logout=" << logout<< '\n';
                        }
                        hrReturnVal = login();
                        if (hrReturnVal)
                        {
                            cout << "Login Error\n";
                        }
                        Sleep(10000);
                        hrReturnVal = logout();
                        if (hrReturnVal)
                        {
                            cout << "Logout Error\n";
                        }
                 }
  
        };
};
int main() {
    Vmr vmr;
    return 0;

}
Post Reply