pyVBAN
Python implementation of the VBAN (VB Audio network) protocol
Original specifications here: https://www.vb-audio.com/Voicemeeter/VBANProtocol_Specifications.pdf
Supported sub-protocols:
- Audio
- Serial (To verify)
- Text
- Service
As I'm currently not using VBAN nor VB-Audio products I have no plans to implement this further. I will do my best to maintain it!
For any feature request, the specs are open, feel free to open a PR 😀
Using the built-in utilities
List devices
$ python -m pyvban.utils.device_list
import logging
import pyvban
logging.basicConfig(level=logging.DEBUG)
pyvban.utils.device_list()
Receiver
$ python -m pyvban.utils.receiver --address 127.0.0.1 --port 6980 --stream Stream1 --device 11
import logging
import pyvban
logging.basicConfig(level=logging.DEBUG)
receiver = pyvban.utils.VBAN_Receiver(
sender_ip="127.0.0.1",
stream_name="Stream1",
port=6980,
device_index=11
)
receiver.run()
Sender
$ python -m pyvban.utils.sender --address 127.0.0.1 --port 6980 --stream Stream1 --rate 48000 --channels 2 --device 1
import logging
import pyvban
logging.basicConfig(level=logging.DEBUG)
sender = pyvban.utils.VBAN_Sender(
receiver_ip="127.0.0.1",
receiver_port=6980,
stream_name="Stream1",
sample_rate=48000,
channels=2,
device_index=1
)
sender.run()
Send text
$ python -m pyvban.utils.send_text --address 127.0.0.1 --port 6980 --stream Command1 "Strip[5].Mute = 0"
import logging
import pyvban
import time
logging.basicConfig(level=logging.DEBUG)
send_text = pyvban.utils.VBAN_SendText(
receiver_ip="127.0.0.1",
receiver_port=6980,
stream_name="Command1"
)
state = False
while True:
state = not state
if state:
send_text.send("Strip[5].Mute = 0")
else:
send_text.send("Strip[5].Mute = 1")
time.sleep(1)
Craft a packet manually
import pyvban
pcm_data = b"" # 128 sample stereo data
header = pyvban.VBANAudioHeader(
sample_rate=pyvban.subprotocols.audio.VBANSampleRates.RATE_48000,
samples_per_frame=128,
channels=2,
format=pyvban.subprotocols.audio.VBANBitResolution.VBAN_BITFMT_16_INT,
codec=pyvban.subprotocols.audio.VBANCodec.VBAN_CODEC_PCM,
stream_name="Stream1",
frame_counter=0,
)
vban_packet = header.to_bytes() + pcm_data
vban_packet = vban_packet[:pyvban.const.VBAN_PROTOCOL_MAX_SIZE]
Parse a packet manually
import pyvban
def run_once(self):
data, addr = socket.recvfrom(pyvban.const.VBAN_PROTOCOL_MAX_SIZE)
packet = pyvban.VBANPacket(data)
if packet.header:
if packet.header.sub_protocol != pyvban.const.VBANProtocols.VBAN_PROTOCOL_AUDIO:
print(f"Received non audio packet {packet}")
return
if packet.header.stream_name != self._stream_name:
print(f"Unexpected stream name \"{packet.header.stream_name}\" != \"{self._stream_name}\"")
return
if addr[0] != self._sender_ip:
print(f"Unexpected sender \"{addr[0]}\" != \"{self._sender_ip}\"")
return
Metadata
Release files for pyVBAN 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyvban-0.1.1.tar.gz | 19.9 kB | Without provenance | Details for pyvban-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyvban-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for pyvban-0.1.1-py3-none-any.whl |
Total release size: 45.9 kB
Release files / pyvban-0.1.1.tar.gz
| Download URL | pyvban-0.1.1.tar.gz |
|---|---|
| Size | 19.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b950074b23b82c549d916eb0b5817d6e0a4566824621dd77b7efe3c29bd44371
|
|
BLAKE2b-256 checksum How to use checksums |
dd1cd2054e7da15ac394e03cb1ca9c612dcc0b6b094eeb0223408fe45607ccb1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.11.0 Windows/10
|
Release files / pyvban-0.1.1-py3-none-any.whl
| Download URL | pyvban-0.1.1-py3-none-any.whl |
|---|---|
| Size | 26.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d78371e1fb1440134f4babe1789ac2db7b5f3c8ef5ab38542bf9f9f32b2f98ce
|
|
BLAKE2b-256 checksum How to use checksums |
d77279291f0585c710d8112fe7dc1c1f4846f8d92674ec0f908c7d2337d51f7a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.11.0 Windows/10
|
Security for pyVBAN 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.