mirror of
https://github.com/onyx-and-iris/nvda-voicemeeter.git
synced 2026-04-07 18:03:35 +00:00
Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2562c02b7e | |||
| aaa2c72668 | |||
| 7648b68b85 | |||
| 5069db97da | |||
| 681bf8e85c | |||
| 8424558f3d | |||
| 39bd5f21ea | |||
| 77dfd00541 | |||
| 790ac10d4a | |||
| ed5f9ae45b | |||
| 962b61f60a | |||
| b2e03aace1 | |||
| 3a52655811 | |||
| 178d6e451b | |||
| fc8ae11555 | |||
| e4afe35fb2 |
101
README.md
101
README.md
@@ -1 +1,100 @@
|
||||
# example-package
|
||||
[](https://pdm.fming.dev)
|
||||
[](https://github.com/psf/black)
|
||||
[](https://pycqa.github.io/isort/)
|
||||
|
||||
# NVDA Voicemeeter
|
||||
|
||||
A remote control app for [Voicemeeter][voicemeeter], designed to be used with the [NVDA screen reader][nvda].
|
||||
|
||||
This is still an early release but it should be usable.
|
||||
|
||||
<img src="./img/settings.png" width=350 alt="Image of Voicemeeter NVDA app settings tab">
|
||||
|
||||
## Requirements
|
||||
|
||||
- [NVDA screen reader][nvda]
|
||||
- [NVDA's Controller Client files][controller_client]
|
||||
- Python 3.10 or greater
|
||||
|
||||
### Installation
|
||||
|
||||
First clone the source files from this repository
|
||||
|
||||
`git clone https://github.com/onyx-and-iris/nvda-voicemeeter.git`
|
||||
|
||||
Then download the [Controller Client][controller_client] and place the files into the directory `controllerClient`.
|
||||
|
||||
If you want to get started quickly and easily I have uploaded some compiled versions of the app in the [Releases][releases] section.
|
||||
|
||||
### Run
|
||||
|
||||
Once the repository is downloaded and the controller client files in place you can launch the GUI with the following `__main__.py`:
|
||||
|
||||
```python
|
||||
import voicemeeterlib
|
||||
|
||||
import nvda_voicemeeter
|
||||
|
||||
KIND_ID = "potato"
|
||||
|
||||
with voicemeeterlib.api(KIND_ID, sync=True) as vm:
|
||||
with nvda_voicemeeter.draw(KIND_ID, vm) as window:
|
||||
window.run()
|
||||
```
|
||||
|
||||
### KIND_ID
|
||||
|
||||
May be one of the following:
|
||||
|
||||
- `basic`
|
||||
- `banana`
|
||||
- `potato`
|
||||
|
||||
### Use
|
||||
|
||||
The app presents four tabs `Settings`, `Physical Strip`, `Virtual Strip` and `Buses`. Navigate between the tabs with `Control + TAB` and `Control + SHIFT + TAB`.
|
||||
|
||||
All controls within the tabs may be navigated between using `TAB`.
|
||||
|
||||
The following controls offer context menus accessed by pressing `SPACE` or `ENTER`:
|
||||
|
||||
- Hardware In
|
||||
- Hardware Out
|
||||
- Patch Composite
|
||||
|
||||
All other buttons can be triggered by pressing `SPACE` or `ENTER`.
|
||||
|
||||
To adjust Patch Asio Inputs to Strips and Patch Insert values use `UP` and `DOWN` arrows when in focus.
|
||||
|
||||
To rename a strip/bus channel navigate to the relevant tab, then press `F2`. This will open a popup window where you can set the channel index (with a spinbox) and set the new label using a text input box.
|
||||
Pressing the `OK` button with an empty text input will clear the label. In this case the label will be read as a default value for that channel. For example, if the leftmost Strip label were cleared, the screen reader will now read `Hardware Input 1`.
|
||||
Pressing `Cancel` will close the popup window with no affect on the label.
|
||||
|
||||
A single menu item `Voicemeeter` can be opened using `Alt` and then `v`. The menu allows you to:
|
||||
|
||||
- Restart Voicemeeter audio engine
|
||||
- Save/Load current settings (as an xml file)
|
||||
- Set a config to load automatically on app startup.
|
||||
|
||||
The `Save Settings` option opens a popup window with two buttons, `Browse` and `Cancel`. Browse opens a Save As dialog, Cancel returns to the main app window.
|
||||
|
||||
`Load Settings` and `Load on Startup` both open an Open dialog box immediately.
|
||||
|
||||
### Issues
|
||||
|
||||
If you have any questions/suggestions feel free to raise an issue or open a new discussion.
|
||||
|
||||
### Special Thanks
|
||||
|
||||
[Mario Loreti](https://www.marioloreti.net/en/) for his help in testing and offering feedback during development.
|
||||
|
||||
[NVAccess](https://www.nvaccess.org/) for creating the open source NVDA screen reader and its controller client.
|
||||
|
||||
[Vincent Burel](https://github.com/vburel2018) for creating Voicemeeter and its SDK.
|
||||
|
||||
[PySimpleGUI](https://github.com/PySimpleGUI) team for creating an awesome GUI framework.
|
||||
|
||||
[voicemeeter]: https://voicemeeter.com/
|
||||
[nvda]: https://www.nvaccess.org/
|
||||
[controller_client]: https://github.com/nvaccess/nvda/tree/master/extras/controllerClient
|
||||
[releases]: https://github.com/onyx-and-iris/nvda-voicemeeter/releases
|
||||
|
||||
BIN
img/buses.png
Normal file
BIN
img/buses.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
BIN
img/physical_strip.png
Normal file
BIN
img/physical_strip.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
BIN
img/settings.png
Normal file
BIN
img/settings.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 39 KiB |
BIN
img/virtual_strip.png
Normal file
BIN
img/virtual_strip.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
8
pdm.lock
generated
8
pdm.lock
generated
@@ -6,7 +6,7 @@ groups = ["default", "build", "lint", "test"]
|
||||
cross_platform = true
|
||||
static_urls = false
|
||||
lock_version = "4.3"
|
||||
content_hash = "sha256:2aaf88f0abb701968bc22eb31fd189810850a505bb93553f67216e4d1d259750"
|
||||
content_hash = "sha256:9051151ac4ac0edefdfaf52faa91dbff89d8bbc942a6ffa61b6ec6fee502aa8a"
|
||||
|
||||
[[package]]
|
||||
name = "altgraph"
|
||||
@@ -271,13 +271,13 @@ files = [
|
||||
|
||||
[[package]]
|
||||
name = "voicemeeter-api"
|
||||
version = "2.4.8"
|
||||
version = "2.4.9"
|
||||
requires_python = ">=3.10,<4.0"
|
||||
summary = "A Python wrapper for the Voiceemeter API"
|
||||
dependencies = [
|
||||
"tomli<3.0.0,>=2.0.1; python_version < \"3.11\"",
|
||||
]
|
||||
files = [
|
||||
{file = "voicemeeter_api-2.4.8-py3-none-any.whl", hash = "sha256:a3ff9e6f7516d2adedde93f6976526b385d8ae6d86598bfe541a44f498f42ea6"},
|
||||
{file = "voicemeeter_api-2.4.8.tar.gz", hash = "sha256:0d37a9f2af0f68087aa9c76a8cfb2ba44c6b75bb344e8dfa9fd18ad2c862730c"},
|
||||
{file = "voicemeeter_api-2.4.9-py3-none-any.whl", hash = "sha256:a09fd07fe3799cd5c880d491048da81d94e49aa97ec753aa1f9289acd27be965"},
|
||||
{file = "voicemeeter_api-2.4.9.tar.gz", hash = "sha256:47ad614a8b9ccb0b4e47acf65666ce0f0537a0890fffda9949e995bea70e679c"},
|
||||
]
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
[project]
|
||||
name = "nvda_voicemeeter"
|
||||
version = "0.1.0"
|
||||
version = "0.1.5"
|
||||
description = "A Voicemeeter app compatible with NVDA"
|
||||
authors = [
|
||||
{name = "onyx-and-iris", email = "code@onyxandiris.online"},
|
||||
{ name = "onyx-and-iris", email = "code@onyxandiris.online" },
|
||||
]
|
||||
dependencies = [
|
||||
"pysimplegui>=4.60.5",
|
||||
"pyparsing>=3.1.1",
|
||||
"voicemeeter-api>=2.4.8",
|
||||
"voicemeeter-api>=2.4.9",
|
||||
]
|
||||
requires-python = ">=3.10,<3.11"
|
||||
readme = "README.md"
|
||||
license = {text = "MIT"}
|
||||
|
||||
[project.license]
|
||||
text = "MIT"
|
||||
|
||||
[tool.pdm.dev-dependencies]
|
||||
build = [
|
||||
@@ -26,5 +28,5 @@ test = [
|
||||
"psgdemos>=1.12.1",
|
||||
]
|
||||
|
||||
[tool.pdm.scripts]
|
||||
build = {shell = "build.ps1"}
|
||||
[tool.pdm.scripts.build]
|
||||
shell = "build.ps1"
|
||||
|
||||
@@ -102,8 +102,6 @@ class Builder:
|
||||
"""tab0 row1 represents hardware outs"""
|
||||
|
||||
def add_physical_device_opts(layout):
|
||||
devices = get_output_device_list(self.vm)
|
||||
devices.append("- remove device selection -")
|
||||
if self.kind.name == "basic":
|
||||
num_outs = self.kind.phys_out + self.kind.virt_out
|
||||
else:
|
||||
@@ -113,7 +111,7 @@ class Builder:
|
||||
psg.ButtonMenu(
|
||||
f"A{i + 1}",
|
||||
size=(6, 3),
|
||||
menu_def=["", devices],
|
||||
menu_def=["", get_output_device_list(i, self.vm)],
|
||||
key=f"HARDWARE OUT||A{i + 1}",
|
||||
)
|
||||
for i in range(num_outs)
|
||||
@@ -296,7 +294,7 @@ class Builder:
|
||||
for j in range(self.kind.phys_out + self.kind.virt_out)
|
||||
]
|
||||
)
|
||||
if i == self.kind.phys_in + self.kind.virt_in - 2:
|
||||
if i == self.kind.phys_in + 1:
|
||||
layout.append(
|
||||
[
|
||||
psg.Button("K", size=(6, 2), key=f"STRIP {i}||MONO"),
|
||||
@@ -325,12 +323,18 @@ class Builder:
|
||||
"""tab3 row represents bus composite toggle"""
|
||||
|
||||
def add_strip_outputs(layout):
|
||||
params = ["MONO", "EQ", "MUTE", "MODE"]
|
||||
if self.vm.kind.name == "basic":
|
||||
params.remove("EQ")
|
||||
label = {"MODE": "BUSMODE"}
|
||||
layout.append(
|
||||
[
|
||||
psg.Button("Mono", size=(6, 2), key=f"BUS {i}||MONO"),
|
||||
psg.Button("EQ", size=(6, 2), key=f"BUS {i}||EQ"),
|
||||
psg.Button("Mute", size=(6, 2), key=f"BUS {i}||MUTE"),
|
||||
psg.Button(f"BUSMODE", size=(12, 2), key=f"BUS {i}||MODE"),
|
||||
psg.Button(
|
||||
label.get(param, param.capitalize()),
|
||||
size=(12 if param == "MODE" else 6, 2),
|
||||
key=f"BUS {i}||{param}",
|
||||
)
|
||||
for param in params
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
@@ -3,7 +3,10 @@ def _make_hardware_ins_cache(vm) -> dict:
|
||||
|
||||
|
||||
def _make_hardware_outs_cache(vm) -> dict:
|
||||
return {**{f"HARDWARE OUT||A{i + 1}": vm.bus[i].device.name for i in range(vm.kind.phys_out)}}
|
||||
hw_outs = {**{f"HARDWARE OUT||A{i + 1}": vm.bus[i].device.name for i in range(vm.kind.phys_out)}}
|
||||
if vm.kind.name == "basic":
|
||||
hw_outs |= {f"HARDWARE OUT||A2": vm.bus[1].device.name}
|
||||
return hw_outs
|
||||
|
||||
|
||||
def _make_param_cache(vm, channel_type) -> dict:
|
||||
|
||||
@@ -13,12 +13,32 @@ def get_insert_checkbox_index(kind, channel, num) -> int:
|
||||
return (2 * kind.phys_in) + (8 * (num - kind.phys_in - 1)) + channel
|
||||
|
||||
|
||||
_rejected_ids = (
|
||||
"VBAudio100VMVAIO3",
|
||||
"{F5735BD4-6EAF-4758-9710-9886E5AD0FF3}",
|
||||
"{0239BE07-CEEF-4236-A900-AA778D432FD4}",
|
||||
)
|
||||
|
||||
|
||||
def get_input_device_list(vm) -> list:
|
||||
return ["{type}: {name}".format(**vm.device.input(i)) for i in range(vm.device.ins)]
|
||||
devices = []
|
||||
for j in range(vm.device.ins):
|
||||
device = vm.device.input(j)
|
||||
if device["id"] not in _rejected_ids:
|
||||
devices.append("{type}: {name}".format(**device))
|
||||
return devices
|
||||
|
||||
|
||||
def get_output_device_list(vm) -> list:
|
||||
return ["{type}: {name}".format(**vm.device.output(i)) for i in range(vm.device.outs)]
|
||||
def get_output_device_list(i, vm) -> list:
|
||||
devices = []
|
||||
for j in range(vm.device.outs):
|
||||
device = vm.device.output(j)
|
||||
if device["id"] not in _rejected_ids:
|
||||
devices.append("{type}: {name}".format(**device))
|
||||
if i == 0:
|
||||
return devices
|
||||
devices.append("- remove device selection -")
|
||||
return [device for device in devices if not device.startswith("asio")]
|
||||
|
||||
|
||||
def get_patch_composite_list(kind) -> list:
|
||||
@@ -94,7 +114,14 @@ def get_channel_identifier_list(vm) -> list:
|
||||
return identifiers
|
||||
|
||||
|
||||
def get_bus_modes() -> list:
|
||||
def get_bus_modes(vm) -> list:
|
||||
if vm.kind.name == "basic":
|
||||
return [
|
||||
"normal",
|
||||
"amix",
|
||||
"repeat",
|
||||
"composite",
|
||||
]
|
||||
return [
|
||||
"normal",
|
||||
"amix",
|
||||
|
||||
@@ -58,6 +58,8 @@ class NVDAVMWindow(psg.Window):
|
||||
self[f"HARDWARE IN||{i + 1}"].Widget.config(**buttonmenu_opts)
|
||||
for i in range(self.kind.phys_out):
|
||||
self[f"HARDWARE OUT||A{i + 1}"].Widget.config(**buttonmenu_opts)
|
||||
if self.kind.name == "basic":
|
||||
self[f"HARDWARE OUT||A2"].Widget.config(**buttonmenu_opts)
|
||||
if self.kind.name != "basic":
|
||||
[self[f"PATCH COMPOSITE||PC{i + 1}"].Widget.config(**buttonmenu_opts) for i in range(self.kind.phys_out)]
|
||||
self["ASIO BUFFER"].Widget.config(**buttonmenu_opts)
|
||||
@@ -138,6 +140,10 @@ class NVDAVMWindow(psg.Window):
|
||||
self[f"HARDWARE OUT||A{i + 1}"].bind("<FocusIn>", "||FOCUS IN")
|
||||
self[f"HARDWARE OUT||A{i + 1}"].bind("<space>", "||KEY SPACE", propagate=False)
|
||||
self[f"HARDWARE OUT||A{i + 1}"].bind("<Return>", "||KEY ENTER", propagate=False)
|
||||
if self.vm.kind.name == "basic":
|
||||
self[f"HARDWARE OUT||A2"].bind("<FocusIn>", "||FOCUS IN")
|
||||
self[f"HARDWARE OUT||A2"].bind("<space>", "||KEY SPACE", propagate=False)
|
||||
self[f"HARDWARE OUT||A2"].bind("<Return>", "||KEY ENTER", propagate=False)
|
||||
|
||||
# Patch ASIO
|
||||
if self.kind.name != "basic":
|
||||
@@ -179,8 +185,11 @@ class NVDAVMWindow(psg.Window):
|
||||
self[f"STRIP {i}||{param}"].bind("<Return>", "||KEY ENTER")
|
||||
|
||||
# Bus Params
|
||||
params = ["MONO", "EQ", "MUTE", "MODE"]
|
||||
if self.vm.kind.name == "basic":
|
||||
params.remove("EQ")
|
||||
for i in range(self.kind.num_bus):
|
||||
for param in ("MONO", "EQ", "MUTE", "MODE"):
|
||||
for param in params:
|
||||
self[f"BUS {i}||{param}"].bind("<FocusIn>", "||FOCUS IN")
|
||||
self[f"BUS {i}||{param}"].bind("<Return>", "||KEY ENTER")
|
||||
|
||||
@@ -228,9 +237,9 @@ class NVDAVMWindow(psg.Window):
|
||||
|
||||
def popup_rename(self, message, title=None, tab=None):
|
||||
if tab == "Physical Strip":
|
||||
upper = self.kind.phys_out + 1
|
||||
upper = self.kind.phys_in + 1
|
||||
elif tab == "Virtual Strip":
|
||||
upper = self.kind.virt_out + 1
|
||||
upper = self.kind.virt_in + 1
|
||||
elif tab == "Buses":
|
||||
upper = self.kind.num_bus + 1
|
||||
|
||||
@@ -314,7 +323,8 @@ class NVDAVMWindow(psg.Window):
|
||||
self[f"STRIP {index}||LABEL"].update(value=label)
|
||||
self.cache["labels"][f"STRIP {index}||LABEL"] = label
|
||||
case "Virtual Strip":
|
||||
label = data.get("Edit") or f"Virtual Input {index + 1}"
|
||||
index += self.kind.phys_in
|
||||
label = data.get("Edit") or f"Virtual Input {index - self.kind.phys_in + 1}"
|
||||
self.vm.strip[index].label = label
|
||||
self[f"STRIP {index}||LABEL"].update(value=label)
|
||||
self.cache["labels"][f"STRIP {index}||LABEL"] = label
|
||||
@@ -400,7 +410,7 @@ class NVDAVMWindow(psg.Window):
|
||||
setattr(self.vm.strip[index].device, "wdm", "")
|
||||
self.TKroot.after(200, self.nvda.speak, f"HARDWARE IN {key} device selection removed")
|
||||
case [driver, device_name]:
|
||||
setattr(self.vm.strip[index].device, driver, device_name.strip())
|
||||
setattr(self.vm.strip[index].device, driver, device_name.lstrip())
|
||||
phonetic = {"mme": "em em e"}
|
||||
self.TKroot.after(
|
||||
200,
|
||||
@@ -421,7 +431,7 @@ class NVDAVMWindow(psg.Window):
|
||||
setattr(self.vm.bus[index].device, "wdm", "")
|
||||
self.TKroot.after(200, self.nvda.speak, f"HARDWARE OUT {key} device selection removed")
|
||||
case [driver, device_name]:
|
||||
setattr(self.vm.bus[index].device, driver, device_name.strip())
|
||||
setattr(self.vm.bus[index].device, driver, device_name.lstrip())
|
||||
phonetic = {"mme": "em em e"}
|
||||
self.TKroot.after(
|
||||
200,
|
||||
@@ -506,7 +516,7 @@ class NVDAVMWindow(psg.Window):
|
||||
case "MONO":
|
||||
if int(index) < self.kind.phys_in:
|
||||
actual = param.lower()
|
||||
elif int(index) == self.kind.phys_in + self.kind.virt_in - 2:
|
||||
elif int(index) == self.kind.phys_in + 1:
|
||||
actual = "k"
|
||||
else:
|
||||
actual = "mc"
|
||||
@@ -536,7 +546,7 @@ class NVDAVMWindow(psg.Window):
|
||||
case "MONO":
|
||||
if int(index) < self.kind.phys_in:
|
||||
actual = param.lower()
|
||||
elif int(index) == self.kind.phys_in + self.kind.virt_in - 2:
|
||||
elif int(index) == self.kind.phys_in + 1:
|
||||
actual = "k"
|
||||
else:
|
||||
actual = "mc"
|
||||
@@ -577,7 +587,7 @@ class NVDAVMWindow(psg.Window):
|
||||
f"{label} bus {param} {'on' if val else 'off'}",
|
||||
)
|
||||
case "MODE":
|
||||
bus_modes = get_bus_modes()
|
||||
bus_modes = get_bus_modes(self.vm)
|
||||
next_index = bus_modes.index(val) + 1
|
||||
if next_index == len(bus_modes):
|
||||
next_index = 0
|
||||
|
||||
Reference in New Issue
Block a user