A Python API to Voicemeeter, a virtual audio mixer for Windows.
This work-in-progress package wraps the Voicemeeter Remote C API and provides a higher-level interface for developers.
Tested against Voicemeeter Potato, release from September 2019.
- Voicemeeter 1 (Basic), 2 (Banana) or 3 (Potato)
- Python 3.6+
git clone https://github.com/Freemanium/voicemeeter-remote-python
cd voicemeeter-remote-python
pip install .
import voicemeeter
# Can be 'basic', 'banana' or 'potato'
kind = 'potato'
# Ensure that Voicemeeter is launched
voicemeeter.launch(kind)
with voicemeeter.remote(kind) as vmr:
# Set the mapping of the second input strip
vmr.inputs[1].A4 = True
print(f'Output A4 of Strip {vmr.inputs[1].label}: {vmr.inputs[1].A4}')
# Set the gain slider of the leftmost output bus
vmr.outputs[0].gain = -6.0
# Also supports assignment through a dict
vmr.apply({
'in-5': dict(A1=True, B1=True, gain=-6.0),
'out-2': dict(mute=True)
})
# Resets all UI elements to a base profile
vmr.reset()
Or if you want to use the API outside of a with statment
import voicemeeter
# Can be 'basic', 'banana' or 'potato'
kind = 'potato'
# Ensure that Voicemeeter is launched
voicemeeter.launch(kind)
vmr = voicemeeter.remote(kind)
vmr.login()
# Set the mapping of the second input strip
vmr.inputs[1].A4 = True
print(f'Output A4 of Strip {vmr.inputs[1].label}: {vmr.inputs[1].A4}')
# Set the gain slider of the leftmost output bus
vmr.outputs[0].gain = -6.0
# Also supports assignment through a dict
vmr.apply({
'in-5': dict(A1=True, B1=True, gain=-6.0),
'out-2': dict(mute=True)
})
# Resets all UI elements to a base profile
vmr.reset()
vmr.logout()
Profiles through config files are supported.
mkdir profiles
mkdir profiles/potato
touch profiles/potato/mySetup.toml
A config can contain any key that remote.apply()
would accept. Additionally, extends
can be provided to inherit from another profile. Two profiles are available by default:
blank
, all inputs off and all sliders to0.0
base
, all physical inputs toA1
, all virtual inputs toB1
, all sliders to0.0
Sample mySetup.toml
extends = 'base'
[in-0]
mute = 1
[in-5]
A1 = 0
A2 = 1
A4 = 1
gain = 0.0
[in-6]
A1 = 0
A2 = 1
A4 = 1
gain = 0.0
A kind specifies a major Voicemeeter version. Currently this encompasses
basic
: Voicemeeterbanana
: Voicemeeter Bananapotato
: Voicemeeter Potato
Launches Voicemeeter. If Voicemeeter is already launched, it is brought to the front. Wait for delay
seconds after a launch is dispatched.
Factory function for remotes. delay
specifies a cooldown time after every command in seconds. Returns a VMRemote
based on the kind_id
.
Use it with a context manager
with voicemeeter.remote('potato') as vmr:
vmr.inputs[0].mute = True
The kind of the Voicemeeter instance.
A tuple of the form (v1, v2, v3, v4)
.
An InputStrip
tuple, containing both physical and virtual.
An OutputBus
tuple, containing both physical and virtual.
Shows Voicemeeter if it's minimized. No effect otherwise.
Closes Voicemeeter.
Restarts Voicemeeter's audio engine.
Updates values through a dict.
Example:
vmr.apply({
'in-5': dict(A1=True, B1=True, gain=-6.0),
'out-2': dict(mute=True)
})
Loads a profile.
Resets everything to the base
profile.
Any property is gettable and settable.
label
: stringsolo
: booleanmute
: booleangain
: float, from -60.0 to 12.0eqgain1
: float, from -12.0 to 12.0eqgain2
: float, from -12.0 to 12.0eqgain3
: float, from -12.0 to 12.0comp
: float, from 0.0 to 10.0gate
: float, from 0.0 to 10.0- Output mapping (e.g.
A1
,B3
, etc.): boolean, depends on the Voicemeeter kind apply()
: Works similar tovmr.apply()
Any property is gettable and settable.
mute
: booleangain
: float, from -60.0 to 12.0apply()
: Works similar tovmr.apply()
True
iff UI parameters have been updated. Use this if to poll for UI updates.
Calls the C API's parameter getters, GetParameterFloat
or GetParameterStringW
respectively. Tries to cache the value on the first call and updates the cached value if vmr.dirty
is True
.
Calls the C API's parameter getters, SetParameterFloat
or SetParameterStringW
respectively.
errors.VMRError
: Base Voicemeeter Remote error class.errors.VMRDriverError
: Raised when a C API function returns an unexpected value.