2022-08-06 08:56:53 +01:00
|
|
|
[![PyPI version](https://badge.fury.io/py/voicemeeter-api.svg)](https://badge.fury.io/py/voicemeeter-api)
|
2022-06-16 16:17:33 +01:00
|
|
|
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/onyx-and-iris/voicemeeter-api-python/blob/dev/LICENSE)
|
2023-08-19 19:40:06 +01:00
|
|
|
[![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)
|
2022-06-16 14:07:12 +01:00
|
|
|
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
|
|
|
|
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
|
2023-10-29 09:40:10 +00:00
|
|
|
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
|
2022-06-16 14:07:12 +01:00
|
|
|
![Tests Status](./tests/basic.svg?dummy=8484744)
|
|
|
|
![Tests Status](./tests/banana.svg?dummy=8484744)
|
|
|
|
![Tests Status](./tests/potato.svg?dummy=8484744)
|
|
|
|
|
|
|
|
# Python Wrapper for Voicemeeter API
|
|
|
|
|
|
|
|
This package offers a Python interface for the Voicemeeter Remote C API.
|
|
|
|
|
|
|
|
For an outline of past/future changes refer to: [CHANGELOG](CHANGELOG.md)
|
|
|
|
|
|
|
|
## Tested against
|
|
|
|
|
2023-06-25 11:14:22 +01:00
|
|
|
- Basic 1.0.8.8
|
|
|
|
- Banana 2.0.6.8
|
|
|
|
- Potato 3.0.2.8
|
2022-06-16 14:07:12 +01:00
|
|
|
|
|
|
|
## Requirements
|
|
|
|
|
|
|
|
- [Voicemeeter](https://voicemeeter.com/)
|
2022-09-03 16:28:19 +01:00
|
|
|
- Python 3.10 or greater
|
2022-06-16 14:07:12 +01:00
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
`pip install voicemeeter-api`
|
|
|
|
|
|
|
|
## `Use`
|
|
|
|
|
|
|
|
Simplest use case, use a context manager to request a Remote class of a kind.
|
|
|
|
|
|
|
|
Login and logout are handled for you in this scenario.
|
|
|
|
|
|
|
|
#### `__main__.py`
|
|
|
|
|
|
|
|
```python
|
|
|
|
import voicemeeterlib
|
|
|
|
|
|
|
|
|
|
|
|
class ManyThings:
|
|
|
|
def __init__(self, vm):
|
|
|
|
self.vm = vm
|
|
|
|
|
|
|
|
def things(self):
|
|
|
|
self.vm.strip[0].label = "podmic"
|
|
|
|
self.vm.strip[0].mute = True
|
|
|
|
print(
|
2022-08-06 10:49:56 +01:00
|
|
|
f"strip 0 ({self.vm.strip[0].label}) mute has been set to {self.vm.strip[0].mute}"
|
2022-06-16 14:07:12 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
def other_things(self):
|
2022-10-19 13:51:25 +01:00
|
|
|
self.vm.bus[3].gain = -6.3
|
2023-06-23 18:29:41 +01:00
|
|
|
self.vm.bus[4].eq.on = True
|
2022-06-16 14:07:12 +01:00
|
|
|
info = (
|
|
|
|
f"bus 3 gain has been set to {self.vm.bus[3].gain}",
|
2023-06-23 18:29:41 +01:00
|
|
|
f"bus 4 eq has been set to {self.vm.bus[4].eq.on}",
|
2022-06-16 14:07:12 +01:00
|
|
|
)
|
|
|
|
print("\n".join(info))
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
2023-06-23 18:29:41 +01:00
|
|
|
KIND_ID = "banana"
|
|
|
|
|
|
|
|
with voicemeeterlib.api(KIND_ID) as vm:
|
2022-06-16 14:07:12 +01:00
|
|
|
do = ManyThings(vm)
|
|
|
|
do.things()
|
|
|
|
do.other_things()
|
|
|
|
|
|
|
|
# set many parameters at once
|
|
|
|
vm.apply(
|
|
|
|
{
|
|
|
|
"strip-2": {"A1": True, "B1": True, "gain": -6.0},
|
2023-06-24 19:06:23 +01:00
|
|
|
"bus-2": {"mute": True, "eq": {"on": True}},
|
2022-06-16 14:07:12 +01:00
|
|
|
"button-0": {"state": True},
|
|
|
|
"vban-in-0": {"on": True},
|
|
|
|
"vban-out-1": {"name": "streamname"},
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|
2023-06-24 19:06:23 +01:00
|
|
|
|
2022-06-16 14:07:12 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
Otherwise you must remember to call `vm.login()`, `vm.logout()` at the start/end of your code.
|
|
|
|
|
2023-06-23 18:29:41 +01:00
|
|
|
## `KIND_ID`
|
2022-06-16 14:07:12 +01:00
|
|
|
|
2023-06-23 18:29:41 +01:00
|
|
|
Pass the kind of Voicemeeter as an argument. KIND_ID may be:
|
2022-06-16 14:07:12 +01:00
|
|
|
|
|
|
|
- `basic`
|
|
|
|
- `banana`
|
|
|
|
- `potato`
|
|
|
|
|
|
|
|
## `Available commands`
|
|
|
|
|
2022-06-27 14:58:39 +01:00
|
|
|
### Strip
|
2022-06-16 14:07:12 +01:00
|
|
|
|
2022-06-27 14:58:39 +01:00
|
|
|
The following properties are available.
|
2022-06-16 14:07:12 +01:00
|
|
|
|
|
|
|
- `mono`: boolean
|
2022-06-27 14:58:39 +01:00
|
|
|
- `solo`: boolean
|
2022-06-16 14:07:12 +01:00
|
|
|
- `mute`: boolean
|
2022-06-27 14:58:39 +01:00
|
|
|
- `gain`: float, from -60.0 to 12.0
|
|
|
|
- `audibility`: float, from 0.0 to 10.0
|
2022-06-16 14:07:12 +01:00
|
|
|
- `limit`: int, from -40 to 12
|
|
|
|
- `A1 - A5`, `B1 - B3`: boolean
|
|
|
|
- `label`: string
|
2022-06-27 14:58:39 +01:00
|
|
|
- `mc`: boolean
|
2022-06-27 16:38:59 +01:00
|
|
|
- `k`: int, from 0 to 4
|
|
|
|
- `bass`: float, from -12.0 to 12.0
|
|
|
|
- `mid`: float, from -12.0 to 12.0
|
|
|
|
- `treble`: float, from -12.0 to 12.0
|
2022-07-16 23:21:55 +01:00
|
|
|
- `reverb`: float, from 0.0 to 10.0
|
|
|
|
- `delay`: float, from 0.0 to 10.0
|
|
|
|
- `fx1`: float, from 0.0 to 10.0
|
|
|
|
- `fx2`: float, from 0.0 to 10.0
|
|
|
|
- `pan_x`: float, from -0.5 to 0.5
|
|
|
|
- `pan_y`: float, from 0.0 to 1.0
|
|
|
|
- `color_x`: float, from -0.5 to 0.5
|
|
|
|
- `color_y`: float, from 0.0 to 1.0
|
|
|
|
- `fx_x`: float, from -0.5 to 0.5
|
|
|
|
- `fx_y`: float, from 0.0 to 1.0
|
|
|
|
- `postreverb`: boolean
|
|
|
|
- `postdelay`: boolean
|
|
|
|
- `postfx1`: boolean
|
|
|
|
- `postfx2`: boolean
|
2022-06-27 16:38:59 +01:00
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```python
|
|
|
|
vm.strip[3].gain = 3.7
|
|
|
|
print(vm.strip[0].label)
|
|
|
|
```
|
2022-06-27 14:58:39 +01:00
|
|
|
|
2022-10-18 16:17:35 +01:00
|
|
|
The following methods are available.
|
2022-06-27 14:58:39 +01:00
|
|
|
|
|
|
|
- `appgain(name, value)`: string, float, from 0.0 to 1.0
|
|
|
|
|
|
|
|
Set the gain in db by value for the app matching name.
|
|
|
|
|
|
|
|
- `appmute(name, value)`: string, bool
|
|
|
|
|
|
|
|
Set mute state as value for the app matching name.
|
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```python
|
|
|
|
vm.strip[5].appmute("Spotify", True)
|
|
|
|
vm.strip[5].appgain("Spotify", 0.5)
|
|
|
|
```
|
|
|
|
|
2023-06-23 18:29:41 +01:00
|
|
|
#### Strip.Comp
|
|
|
|
|
2023-06-25 13:47:21 +01:00
|
|
|
The following properties are available.
|
|
|
|
|
2023-06-23 18:29:41 +01:00
|
|
|
- `knob`: float, from 0.0 to 10.0
|
|
|
|
- `gainin`: float, from -24.0 to 24.0
|
|
|
|
- `ratio`: float, from 1.0 to 8.0
|
|
|
|
- `threshold`: float, from -40.0 to -3.0
|
|
|
|
- `attack`: float, from 0.0 to 200.0
|
|
|
|
- `release`: float, from 0.0 to 5000.0
|
|
|
|
- `knee`: float, from 0.0 to 1.0
|
|
|
|
- `gainout`: float, from -24.0 to 24.0
|
|
|
|
- `makeup`: boolean
|
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```python
|
|
|
|
print(vm.strip[4].comp.knob)
|
|
|
|
```
|
|
|
|
|
2023-06-25 13:47:21 +01:00
|
|
|
Strip Comp parameters are defined for PhysicalStrips.
|
|
|
|
|
|
|
|
`knob` defined for all versions, all other parameters potato only.
|
2023-06-23 18:29:41 +01:00
|
|
|
|
|
|
|
#### Strip.Gate
|
|
|
|
|
2023-06-25 13:47:21 +01:00
|
|
|
The following properties are available.
|
|
|
|
|
2023-06-23 18:29:41 +01:00
|
|
|
- `knob`: float, from 0.0 to 10.0
|
|
|
|
- `threshold`: float, from -60.0 to -10.0
|
|
|
|
- `damping`: float, from -60.0 to -10.0
|
|
|
|
- `bpsidechain`: int, from 100 to 4000
|
|
|
|
- `attack`: float, from 0.0 to 1000.0
|
|
|
|
- `hold`: float, from 0.0 to 5000.0
|
|
|
|
- `release`: float, from 0.0 to 5000.0
|
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```python
|
|
|
|
vm.strip[2].gate.attack = 300.8
|
|
|
|
```
|
|
|
|
|
2023-06-25 13:47:21 +01:00
|
|
|
Strip Gate parameters are defined for PhysicalStrips.
|
|
|
|
|
|
|
|
`knob` defined for all versions, all other parameters potato only.
|
2023-06-23 18:29:41 +01:00
|
|
|
|
|
|
|
#### Strip.Denoiser
|
|
|
|
|
2023-06-25 13:47:21 +01:00
|
|
|
The following properties are available.
|
|
|
|
|
2023-06-23 18:29:41 +01:00
|
|
|
- `knob`: float, from 0.0 to 10.0
|
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```python
|
|
|
|
vm.strip[0].denoiser.knob = 0.5
|
|
|
|
```
|
|
|
|
|
|
|
|
Strip Denoiser parameters are defined for PhysicalStrips, potato version only.
|
|
|
|
|
|
|
|
#### Strip.EQ
|
|
|
|
|
|
|
|
The following properties are available.
|
|
|
|
|
|
|
|
- `on`: boolean
|
|
|
|
- `ab`: boolean
|
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```python
|
|
|
|
vm.strip[0].eq.ab = True
|
|
|
|
```
|
|
|
|
|
|
|
|
Strip EQ parameters are defined for PhysicalStrips, potato version only.
|
|
|
|
|
|
|
|
##### Strip.Gainlayers
|
2022-06-27 15:00:48 +01:00
|
|
|
|
2022-06-27 14:58:39 +01:00
|
|
|
- `gain`: float, from -60.0 to 12.0
|
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```python
|
|
|
|
vm.strip[3].gainlayer[3].gain = 3.7
|
|
|
|
```
|
|
|
|
|
|
|
|
Gainlayers are defined for potato version only.
|
|
|
|
|
2023-06-23 18:29:41 +01:00
|
|
|
##### Strip.Levels
|
2022-06-27 14:58:39 +01:00
|
|
|
|
|
|
|
The following properties are available.
|
|
|
|
|
|
|
|
- `prefader`
|
|
|
|
- `postfader`
|
|
|
|
- `postmute`
|
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```python
|
|
|
|
print(vm.strip[3].levels.prefader)
|
|
|
|
```
|
|
|
|
|
|
|
|
Level properties will return -200.0 if no audio detected.
|
|
|
|
|
|
|
|
### Bus
|
|
|
|
|
|
|
|
The following properties are available.
|
|
|
|
|
|
|
|
- `mono`: boolean
|
|
|
|
- `mute`: boolean
|
2022-06-27 15:11:18 +01:00
|
|
|
- `sel`: boolean
|
2022-06-27 14:58:39 +01:00
|
|
|
- `gain`: float, from -60.0 to 12.0
|
|
|
|
- `label`: string
|
2022-07-16 23:21:55 +01:00
|
|
|
- `returnreverb`: float, from 0.0 to 10.0
|
|
|
|
- `returndelay`: float, from 0.0 to 10.0
|
|
|
|
- `returnfx1`: float, from 0.0 to 10.0
|
|
|
|
- `returnfx2`: float, from 0.0 to 10.0
|
|
|
|
- `monitor`: boolean
|
2022-06-16 14:07:12 +01:00
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```python
|
2022-06-27 16:38:59 +01:00
|
|
|
vm.bus[3].gain = 3.7
|
|
|
|
print(vm.bus[0].label)
|
2022-06-16 14:07:12 +01:00
|
|
|
|
2022-06-27 16:38:59 +01:00
|
|
|
vm.bus[4].mono = True
|
|
|
|
```
|
|
|
|
|
2023-06-23 18:29:41 +01:00
|
|
|
##### Bus.EQ
|
|
|
|
|
|
|
|
The following properties are available.
|
|
|
|
|
|
|
|
- `on`: boolean
|
|
|
|
- `ab`: boolean
|
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```python
|
|
|
|
vm.bus[3].eq.on = True
|
|
|
|
```
|
|
|
|
|
|
|
|
##### Bus.Modes
|
2022-06-27 16:38:59 +01:00
|
|
|
|
2022-07-16 21:24:51 +01:00
|
|
|
The following properties are available.
|
|
|
|
|
2022-06-27 16:38:59 +01:00
|
|
|
- `normal`: boolean
|
|
|
|
- `amix`: boolean
|
|
|
|
- `bmix`: boolean
|
|
|
|
- `composite`: boolean
|
|
|
|
- `tvmix`: boolean
|
|
|
|
- `upmix21`: boolean
|
|
|
|
- `upmix41`: boolean
|
|
|
|
- `upmix61`: boolean
|
|
|
|
- `centeronly`: boolean
|
|
|
|
- `lfeonly`: boolean
|
|
|
|
- `rearonly`: boolean
|
|
|
|
|
2022-07-16 21:24:51 +01:00
|
|
|
The following methods are available.
|
|
|
|
|
|
|
|
- `get()`: Returns the current bus mode
|
|
|
|
|
2022-06-27 16:38:59 +01:00
|
|
|
example:
|
|
|
|
|
|
|
|
```python
|
|
|
|
vm.bus[4].mode.amix = True
|
2022-07-16 21:24:51 +01:00
|
|
|
|
|
|
|
print(vm.bus[2].mode.get())
|
2022-06-16 14:07:12 +01:00
|
|
|
```
|
|
|
|
|
2023-06-23 18:29:41 +01:00
|
|
|
##### Bus.Levels
|
2022-06-27 15:00:48 +01:00
|
|
|
|
|
|
|
The following properties are available.
|
|
|
|
|
|
|
|
- `all`
|
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```python
|
|
|
|
print(vm.bus[0].levels.all)
|
|
|
|
```
|
|
|
|
|
|
|
|
`levels.all` will return -200.0 if no audio detected.
|
|
|
|
|
2022-06-27 14:58:39 +01:00
|
|
|
### Strip | Bus
|
|
|
|
|
|
|
|
The following methods are available.
|
|
|
|
|
|
|
|
- `fadeto(amount, time)`: float, int
|
|
|
|
- `fadeby(amount, time)`: float, int
|
|
|
|
|
|
|
|
Modify gain to or by the selected amount in db over a time interval in ms.
|
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```python
|
|
|
|
vm.strip[0].fadeto(-10.3, 1000)
|
|
|
|
vm.bus[3].fadeby(-5.6, 500)
|
|
|
|
```
|
|
|
|
|
2022-10-11 12:53:08 +01:00
|
|
|
#### Strip.Device | Bus.Device
|
|
|
|
|
|
|
|
The following properties are available
|
|
|
|
|
|
|
|
- `name`: str
|
|
|
|
- `sr`: int
|
|
|
|
- `wdm`: str
|
|
|
|
- `ks`: str
|
|
|
|
- `mme`: str
|
|
|
|
- `asio`: str
|
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```python
|
|
|
|
print(vm.strip[0].device.name)
|
|
|
|
vm.bus[0].device.asio = "Audient USB Audio ASIO Driver"
|
|
|
|
```
|
|
|
|
|
|
|
|
strip|bus device parameters are defined for physical channels only.
|
2022-10-17 15:21:55 +01:00
|
|
|
|
2022-10-11 12:53:08 +01:00
|
|
|
name, sr are read only. wdm, ks, mme, asio are write only.
|
|
|
|
|
2022-06-16 14:07:12 +01:00
|
|
|
### Macrobuttons
|
|
|
|
|
2022-06-27 14:58:39 +01:00
|
|
|
The following properties are available.
|
2022-06-16 14:07:12 +01:00
|
|
|
|
|
|
|
- `state`: boolean
|
|
|
|
- `stateonly`: boolean
|
|
|
|
- `trigger`: boolean
|
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```python
|
2022-06-27 16:38:59 +01:00
|
|
|
vm.button[37].state = True
|
|
|
|
vm.button[55].trigger = False
|
2022-06-16 14:07:12 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
### Recorder
|
|
|
|
|
2022-06-27 14:58:39 +01:00
|
|
|
The following methods are available
|
2022-06-16 14:07:12 +01:00
|
|
|
|
|
|
|
- `play()`
|
|
|
|
- `stop()`
|
|
|
|
- `pause()`
|
|
|
|
- `record()`
|
|
|
|
- `ff()`
|
|
|
|
- `rew()`
|
2023-06-30 23:53:08 +01:00
|
|
|
- `load(filepath)`: raw string
|
|
|
|
- `goto(time_string)`: time string in format `hh:mm:ss`
|
|
|
|
- `filetype(filetype)`: string, ("wav", "aiff", "bwf", "mp3")
|
2022-06-27 14:58:39 +01:00
|
|
|
|
|
|
|
The following properties are available
|
2022-06-27 15:00:48 +01:00
|
|
|
|
2022-06-16 14:07:12 +01:00
|
|
|
- `A1 - A5`: boolean
|
2023-07-01 20:26:44 +01:00
|
|
|
- `B1 - B3`: boolean
|
2023-06-30 23:53:08 +01:00
|
|
|
- `samplerate`: int, (22050, 24000, 32000, 44100, 48000, 88200, 96000, 176400, 192000)
|
|
|
|
- `bitresolution`: int, (8, 16, 24, 32)
|
|
|
|
- `channel`: int, from 1 to 8
|
|
|
|
- `kbps`: int, (32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320)
|
|
|
|
- `gain`: float, from -60.0 to 12.0
|
2022-06-16 14:07:12 +01:00
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```python
|
|
|
|
vm.recorder.play()
|
|
|
|
vm.recorder.stop()
|
|
|
|
|
|
|
|
# Disable recorder out channel B2
|
|
|
|
vm.recorder.B2 = False
|
|
|
|
|
|
|
|
# filepath as raw string
|
|
|
|
vm.recorder.load(r'C:\music\mytune.mp3')
|
2023-06-30 23:53:08 +01:00
|
|
|
|
|
|
|
# set the goto time to 1m 30s
|
|
|
|
vm.recorder.goto("00:01:30")
|
|
|
|
```
|
|
|
|
|
2023-07-01 00:05:01 +01:00
|
|
|
#### Recorder.Mode
|
2023-06-30 23:53:08 +01:00
|
|
|
|
|
|
|
The following properties are available
|
|
|
|
|
|
|
|
- `recbus`: boolean
|
|
|
|
- `playonload`: boolean
|
|
|
|
- `loop`: boolean
|
|
|
|
- `multitrack`: boolean
|
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```python
|
|
|
|
# Enable loop play
|
|
|
|
vm.recorder.mode.loop = True
|
2022-06-16 14:07:12 +01:00
|
|
|
```
|
|
|
|
|
2023-06-30 23:53:08 +01:00
|
|
|
#### Recorder.ArmStrip[i]|ArmBus[i]
|
|
|
|
|
|
|
|
The following method is available
|
|
|
|
|
|
|
|
- `set(val)`: boolean
|
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```python
|
|
|
|
# Arm strip 3
|
|
|
|
vm.recorder.armstrip[3].set(True)
|
|
|
|
# Arm bus 0
|
|
|
|
vm.recorder.armbus[0].set(True)
|
|
|
|
```
|
2022-06-27 14:58:39 +01:00
|
|
|
|
2022-06-16 14:07:12 +01:00
|
|
|
### VBAN
|
|
|
|
|
|
|
|
- `vm.vban.enable()` `vm.vban.disable()` Turn VBAN on or off
|
|
|
|
|
2022-06-27 14:58:39 +01:00
|
|
|
##### Instream | Outstream
|
|
|
|
|
|
|
|
The following properties are available.
|
2022-06-16 14:07:12 +01:00
|
|
|
|
|
|
|
- `on`: boolean
|
|
|
|
- `name`: string
|
|
|
|
- `ip`: string
|
|
|
|
- `port`: int, range from 1024 to 65535
|
|
|
|
- `sr`: int, (11025, 16000, 22050, 24000, 32000, 44100, 48000, 64000, 88200, 96000)
|
|
|
|
- `channel`: int, from 1 to 8
|
|
|
|
- `bit`: int, 16 or 24
|
|
|
|
- `quality`: int, from 0 to 4
|
|
|
|
- `route`: int, from 0 to 8
|
|
|
|
|
2022-06-27 14:58:39 +01:00
|
|
|
`SR`, `channel` and `bit` are defined as:
|
2022-06-27 15:00:48 +01:00
|
|
|
|
2022-06-27 14:58:39 +01:00
|
|
|
- readonly for instreams.
|
|
|
|
- read and write for outstreams.
|
2022-06-16 14:07:12 +01:00
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```python
|
|
|
|
# turn VBAN on
|
|
|
|
vm.vban.enable()
|
|
|
|
|
|
|
|
# turn on vban instream 0
|
|
|
|
vm.vban.instream[0].on = True
|
|
|
|
|
|
|
|
# set bit property for outstream 3 to 24
|
|
|
|
vm.vban.outstream[3].bit = 24
|
|
|
|
```
|
|
|
|
|
|
|
|
### Command
|
|
|
|
|
2022-06-27 14:58:39 +01:00
|
|
|
Certain 'special' commands are defined by the API as performing actions rather than setting values.
|
2022-07-16 23:21:55 +01:00
|
|
|
|
2022-06-27 14:58:39 +01:00
|
|
|
The following methods are available:
|
2022-06-16 14:07:12 +01:00
|
|
|
|
|
|
|
- `show()` : Bring Voiceemeter GUI to the front
|
|
|
|
- `shutdown()` : Shuts down the GUI
|
|
|
|
- `restart()` : Restart the audio engine
|
2022-07-16 21:24:51 +01:00
|
|
|
- `reset()`: Applies the `reset` config. (phys strip B1, virt strip A1, gains, comp, gate 0.0, mute, mono, solo, eq false)
|
2022-06-16 14:07:12 +01:00
|
|
|
|
2022-06-27 14:58:39 +01:00
|
|
|
The following properties are available.
|
2022-06-16 14:07:12 +01:00
|
|
|
|
|
|
|
- `showvbanchat`: boolean
|
|
|
|
- `lock`: boolean
|
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```python
|
|
|
|
vm.command.restart()
|
2022-06-27 16:38:59 +01:00
|
|
|
vm.command.showvbanchat = True
|
2022-06-16 14:07:12 +01:00
|
|
|
```
|
|
|
|
|
2022-06-27 14:58:39 +01:00
|
|
|
`showvbanchat` and `lock` are write only.
|
|
|
|
|
2022-06-27 16:49:37 +01:00
|
|
|
### Device
|
|
|
|
|
|
|
|
- `ins` `outs` : Returns the number of input/output devices
|
|
|
|
- `input(i)` `output(i)` : Returns a dict of device properties for device[i]
|
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```python
|
|
|
|
import voicemeeterlib
|
2023-06-23 18:29:41 +01:00
|
|
|
with voicemeeterlib.api(KIND_ID) as vm:
|
2022-06-27 16:49:37 +01:00
|
|
|
for i in range(vm.device.ins):
|
|
|
|
print(vm.device.input(i))
|
|
|
|
```
|
|
|
|
|
2022-07-16 23:21:55 +01:00
|
|
|
### FX
|
|
|
|
|
2022-07-21 23:19:24 +01:00
|
|
|
The following properties are available:
|
2022-07-16 23:21:55 +01:00
|
|
|
|
|
|
|
- `reverb`: boolean
|
|
|
|
- `reverb_ab`: boolean
|
|
|
|
- `delay`: boolean
|
|
|
|
- `delay_ab`: boolean
|
|
|
|
|
2022-07-21 23:19:24 +01:00
|
|
|
example:
|
|
|
|
|
|
|
|
```python
|
|
|
|
vm.fx.reverb_ab = True
|
|
|
|
```
|
|
|
|
|
|
|
|
### Patch
|
|
|
|
|
|
|
|
The following properties are available:
|
|
|
|
|
|
|
|
- `postfadercomposite`: boolean
|
|
|
|
- `postfxinsert`: boolean
|
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```python
|
|
|
|
vm.patch.postfxinsert = False
|
|
|
|
```
|
|
|
|
|
|
|
|
##### asio[i]
|
|
|
|
|
|
|
|
- `get()`: int
|
|
|
|
- `set(patch_in)`: int, valid range determined by connected device.
|
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```python
|
|
|
|
vm.patch.asio[3].set(4)
|
|
|
|
```
|
|
|
|
|
|
|
|
i, from 0 to 10
|
|
|
|
|
|
|
|
##### A2[i] - A5[i]
|
|
|
|
|
|
|
|
- `get()`: int
|
|
|
|
- `set(patch_out)`: int, valid range determined by connected device.
|
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```python
|
2022-07-21 23:23:55 +01:00
|
|
|
vm.patch.A3[5].set(3)
|
2022-07-21 23:19:24 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
i, from 0 to 8.
|
|
|
|
|
|
|
|
##### composite[i]
|
|
|
|
|
|
|
|
- `get()`: int
|
|
|
|
- `set(channel)`: int, from 0 up to number of channels depending on version.
|
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```python
|
2022-07-22 13:13:15 +01:00
|
|
|
vm.patch.composite[7].set(4)
|
2022-07-21 23:19:24 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
i, from 0 to 8.
|
|
|
|
|
|
|
|
##### insert[i]
|
|
|
|
|
|
|
|
- `on`: boolean
|
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```python
|
|
|
|
vm.patch.insert[18].on = True
|
|
|
|
```
|
|
|
|
|
|
|
|
i, from 0 up to number of channels depending on version.
|
|
|
|
|
|
|
|
### Option
|
|
|
|
|
|
|
|
The following properties are available:
|
|
|
|
|
|
|
|
- `sr`: int
|
|
|
|
- `asiosr`: boolean
|
|
|
|
- `monitoronsel`: boolean
|
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```python
|
|
|
|
vm.option.sr = 48000
|
|
|
|
```
|
|
|
|
|
|
|
|
The following methods are available:
|
|
|
|
|
2023-07-01 19:50:54 +01:00
|
|
|
- `buffer(driver, buf)` : Set buffer size for particular audio driver.
|
|
|
|
- buf: int, from 128 to 2048
|
|
|
|
- driver:str, ("mme", "wdm", "ks", "asio")
|
2022-07-21 23:19:24 +01:00
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```python
|
|
|
|
vm.option.buffer("wdm", 512)
|
|
|
|
```
|
|
|
|
|
|
|
|
##### delay[i]
|
|
|
|
|
|
|
|
- `get()`: int
|
|
|
|
- `set(delay)`: int, from 0 to 500
|
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```python
|
|
|
|
vm.option.delay[4].set(30)
|
|
|
|
```
|
|
|
|
|
|
|
|
i, from 0 up to 4.
|
|
|
|
|
2022-07-24 14:38:16 +01:00
|
|
|
### Midi
|
|
|
|
|
|
|
|
The following properties are available:
|
|
|
|
|
|
|
|
- `channel`: int, returns the midi channel
|
|
|
|
- `current`: int, returns the current (or most recently pressed) key
|
|
|
|
|
|
|
|
The following methods are available:
|
|
|
|
|
|
|
|
- `get(key)`: int, returns most recent velocity value for a key
|
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```python
|
|
|
|
print(vm.midi.get(12))
|
|
|
|
```
|
|
|
|
|
|
|
|
get() may return None if no value for requested key in midi cache
|
|
|
|
|
2022-06-16 14:07:12 +01:00
|
|
|
### Multiple parameters
|
|
|
|
|
|
|
|
- `apply`
|
|
|
|
Set many strip/bus/macrobutton/vban parameters at once, for example:
|
|
|
|
|
|
|
|
```python
|
|
|
|
vm.apply(
|
|
|
|
{
|
|
|
|
"strip-2": {"A1": True, "B1": True, "gain": -6.0},
|
2023-06-24 19:06:23 +01:00
|
|
|
"bus-2": {"mute": True, "eq": {"on": True}},
|
2022-06-16 14:07:12 +01:00
|
|
|
"button-0": {"state": True},
|
|
|
|
"vban-in-0": {"on": True},
|
|
|
|
"vban-out-1": {"name": "streamname"},
|
|
|
|
}
|
|
|
|
)
|
|
|
|
```
|
|
|
|
|
|
|
|
Or for each class you may do:
|
|
|
|
|
|
|
|
```python
|
2023-07-11 19:45:43 +01:00
|
|
|
vm.strip[0].apply({"mute": True, "gain": 3.2, "A1": True})
|
|
|
|
vm.vban.outstream[0].apply({"on": True, "name": "streamname", "bit": 24})
|
2022-06-16 14:07:12 +01:00
|
|
|
```
|
|
|
|
|
2022-06-16 16:56:45 +01:00
|
|
|
## Config Files
|
|
|
|
|
2023-06-30 23:53:08 +01:00
|
|
|
`vm.apply_config(configname)`
|
2022-06-16 16:56:45 +01:00
|
|
|
|
|
|
|
You may load config files in TOML format.
|
2022-06-27 15:03:30 +01:00
|
|
|
Three example configs have been included with the package. Remember to save
|
2023-07-11 19:34:43 +01:00
|
|
|
current settings before loading a user config. To load one you may do:
|
2022-06-16 16:56:45 +01:00
|
|
|
|
|
|
|
```python
|
|
|
|
import voicemeeterlib
|
|
|
|
with voicemeeterlib.api('banana') as vm:
|
2022-06-16 18:58:31 +01:00
|
|
|
vm.apply_config('example')
|
2022-06-16 16:56:45 +01:00
|
|
|
```
|
|
|
|
|
2023-07-11 19:34:43 +01:00
|
|
|
Your configs may be located in one of the following paths:
|
|
|
|
- \<current working directory\> / "configs" / kind_id
|
|
|
|
- \<user home directory\> / ".config" / "voicemeeter" / kind_id
|
|
|
|
- \<user home directory\> / "Documents" / "Voicemeeter" / "configs" / kind_id
|
|
|
|
|
|
|
|
If a config with the same name is located in multiple locations, only the first one found is loaded into memory, in the above order.
|
|
|
|
|
|
|
|
#### `config extends`
|
|
|
|
|
|
|
|
You may also load a config that extends another config with overrides or additional parameters.
|
|
|
|
|
|
|
|
You just need to define a key `extends` in the config TOML, that names the config to be extended.
|
|
|
|
|
|
|
|
Three example 'extender' configs are included with the repo. You may load them with:
|
|
|
|
|
|
|
|
```python
|
|
|
|
import voicemeeterlib
|
|
|
|
with voicemeeterlib.api('banana') as vm:
|
|
|
|
vm.apply_config('extender')
|
|
|
|
```
|
2022-06-16 16:56:45 +01:00
|
|
|
|
2022-09-29 10:26:55 +01:00
|
|
|
## Events
|
2022-06-16 14:07:12 +01:00
|
|
|
|
2023-06-23 18:29:41 +01:00
|
|
|
By default, NO events are listened for. Use events kwargs to enable specific event types.
|
2022-06-16 14:07:12 +01:00
|
|
|
|
2022-09-29 10:26:55 +01:00
|
|
|
example:
|
2022-08-02 09:19:30 +01:00
|
|
|
|
2022-09-29 10:26:55 +01:00
|
|
|
```python
|
|
|
|
import voicemeeterlib
|
2023-06-23 18:29:41 +01:00
|
|
|
# Set event updates to occur every 50ms
|
|
|
|
# Listen for level updates only
|
2023-07-13 08:50:41 +01:00
|
|
|
with voicemeeterlib.api('banana', ratelimit=0.05, ldirty=True) as vm:
|
2022-09-29 10:26:55 +01:00
|
|
|
...
|
|
|
|
```
|
2022-08-02 09:19:30 +01:00
|
|
|
|
2023-06-23 18:29:41 +01:00
|
|
|
#### `vm.observer`
|
2022-08-02 09:19:30 +01:00
|
|
|
|
2022-09-29 10:26:55 +01:00
|
|
|
Use the Subject class to register an app as event observer.
|
2022-08-02 09:19:30 +01:00
|
|
|
|
2022-09-29 10:26:55 +01:00
|
|
|
The following methods are available:
|
2022-08-02 09:19:30 +01:00
|
|
|
|
2022-09-29 10:26:55 +01:00
|
|
|
- `add`: registers an app as an event observer
|
|
|
|
- `remove`: deregisters an app as an event observer
|
2022-08-02 09:19:30 +01:00
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```python
|
2022-10-06 16:45:08 +01:00
|
|
|
# register an app to receive updates
|
|
|
|
class App():
|
|
|
|
def __init__(self, vm):
|
2023-06-23 18:29:41 +01:00
|
|
|
vm.observer.add(self)
|
2022-10-06 16:45:08 +01:00
|
|
|
...
|
2022-08-02 09:19:30 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
#### `vm.event`
|
|
|
|
|
2022-10-06 16:45:08 +01:00
|
|
|
Use the event class to toggle updates as necessary.
|
|
|
|
|
|
|
|
The following properties are available:
|
|
|
|
|
|
|
|
- `pdirty`: boolean
|
|
|
|
- `mdirty`: boolean
|
|
|
|
- `midi`: boolean
|
|
|
|
- `ldirty`: boolean
|
2022-08-02 09:19:30 +01:00
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```python
|
2022-10-06 16:45:08 +01:00
|
|
|
vm.event.ldirty = True
|
2022-08-02 09:19:30 +01:00
|
|
|
|
2022-10-06 16:45:08 +01:00
|
|
|
vm.event.pdirty = False
|
2022-10-06 18:07:34 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
Or add, remove a list of events.
|
|
|
|
|
|
|
|
The following methods are available:
|
|
|
|
|
|
|
|
- `add()`
|
|
|
|
- `remove()`
|
|
|
|
- `get()`
|
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```python
|
|
|
|
vm.event.remove(["pdirty", "mdirty", "midi"])
|
2022-08-02 09:19:30 +01:00
|
|
|
|
|
|
|
# get a list of currently subscribed
|
|
|
|
print(vm.event.get())
|
|
|
|
```
|
|
|
|
|
2022-09-29 10:26:55 +01:00
|
|
|
## Remote class
|
|
|
|
|
2023-06-23 18:29:41 +01:00
|
|
|
`voicemeeterlib.api(KIND_ID: str)`
|
2022-09-29 10:26:55 +01:00
|
|
|
|
|
|
|
You may pass the following optional keyword arguments:
|
|
|
|
|
|
|
|
- `sync`: boolean=False, force the getters to wait for dirty parameters to clear. For most cases leave this as False.
|
|
|
|
- `ratelimit`: float=0.033, how often to check for updates in ms.
|
2023-06-23 18:29:41 +01:00
|
|
|
- `pdirty`: boolean=False, parameter updates
|
|
|
|
- `mdirty`: boolean=False, macrobutton updates
|
|
|
|
- `midi`: boolean=False, midi updates
|
|
|
|
- `ldirty`: boolean=False, level updates
|
2023-10-27 17:29:53 +01:00
|
|
|
- `timeout`: float=2.0, maximum time to wait for a successful login in seconds
|
2022-09-29 10:26:55 +01:00
|
|
|
|
2022-06-16 14:07:12 +01:00
|
|
|
Access to lower level Getters and Setters are provided with these functions:
|
|
|
|
|
2022-06-27 16:38:59 +01:00
|
|
|
- `vm.get(param, is_string=False)`: For getting the value of any parameter. Set string to True if getting a property value expected to return a string.
|
2022-06-16 14:07:12 +01:00
|
|
|
- `vm.set(param, value)`: For setting the value of any parameter.
|
|
|
|
|
|
|
|
example:
|
|
|
|
|
|
|
|
```python
|
|
|
|
vm.get('Strip[2].Mute')
|
|
|
|
vm.set('Strip[4].Label', 'stripname')
|
|
|
|
vm.set('Strip[0].Gain', -3.6)
|
|
|
|
```
|
|
|
|
|
2023-06-25 11:00:32 +01:00
|
|
|
Access to lower level polling functions are provided with the following property objects:
|
|
|
|
|
2023-07-13 08:50:41 +01:00
|
|
|
##### `vm.pdirty`
|
2023-06-25 11:00:32 +01:00
|
|
|
|
|
|
|
True iff a parameter has been updated.
|
|
|
|
|
2023-07-13 08:50:41 +01:00
|
|
|
##### `vm.mdirty`
|
2023-06-25 11:00:32 +01:00
|
|
|
|
|
|
|
True iff a macrobutton has been updated.
|
|
|
|
|
2023-07-13 08:50:41 +01:00
|
|
|
##### `vm.ldirty`
|
2023-06-25 11:00:32 +01:00
|
|
|
|
|
|
|
True iff a level has been updated.
|
|
|
|
|
|
|
|
|
2023-07-13 08:54:21 +01:00
|
|
|
### Errors
|
2023-07-13 08:50:41 +01:00
|
|
|
|
2023-08-18 20:09:59 +01:00
|
|
|
- `errors.VMError`: Base custom exception class.
|
2023-07-13 08:50:41 +01:00
|
|
|
- `errors.InstallError`: Exception raised when installation errors occur.
|
|
|
|
- `errors.CAPIError`: Exception raised when the C-API returns error values.
|
2023-08-13 16:52:04 +01:00
|
|
|
- The following attributes are available:
|
|
|
|
- `fn_name`: C-API function name.
|
|
|
|
- `code`: error code
|
|
|
|
- For a full list of error codes check the [VoicemeeterRemote header file][Voicemeeter Remote Header].
|
2023-07-13 08:50:41 +01:00
|
|
|
|
|
|
|
|
|
|
|
### Logging
|
|
|
|
|
|
|
|
It's possible to see the messages sent by the interface's setters and getters, may be useful for debugging.
|
|
|
|
|
|
|
|
example:
|
|
|
|
```python
|
|
|
|
import voicemeeterlib
|
|
|
|
|
|
|
|
logging.basicConfig(level=logging.DEBUG)
|
|
|
|
|
|
|
|
with voicemeeterlib.api("banana") as vm:
|
|
|
|
...
|
|
|
|
```
|
|
|
|
|
|
|
|
|
2022-06-16 14:07:12 +01:00
|
|
|
### Run tests
|
|
|
|
|
|
|
|
To run all tests:
|
|
|
|
|
|
|
|
```
|
|
|
|
pytest -v
|
|
|
|
```
|
|
|
|
|
|
|
|
### Official Documentation
|
|
|
|
|
2024-01-03 09:29:21 +00:00
|
|
|
- [Voicemeeter Remote C API](https://github.com/onyx-and-iris/Voicemeeter-SDK/blob/main/VoicemeeterRemoteAPI.pdf)
|
2023-07-13 08:50:41 +01:00
|
|
|
|
|
|
|
|
2024-01-03 09:32:12 +00:00
|
|
|
[Voicemeeter Remote Header]: https://github.com/onyx-and-iris/Voicemeeter-SDK/blob/main/VoicemeeterRemote.h
|