{"id":18147436,"url":"https://github.com/thestaticturtle/pyvban","last_synced_at":"2025-05-08T03:54:07.003Z","repository":{"id":44563437,"uuid":"168755592","full_name":"TheStaticTurtle/pyVBAN","owner":"TheStaticTurtle","description":"python implementation of the VBAN (VB Audio network) protocol","archived":false,"fork":false,"pushed_at":"2024-08-25T14:55:55.000Z","size":43,"stargazers_count":53,"open_issues_count":0,"forks_count":15,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-08T03:54:00.505Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TheStaticTurtle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-01T20:22:59.000Z","updated_at":"2025-04-09T15:57:52.000Z","dependencies_parsed_at":"2024-11-16T07:04:29.887Z","dependency_job_id":"c4eb892d-e9c6-4758-9cfb-ecee637e5456","html_url":"https://github.com/TheStaticTurtle/pyVBAN","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheStaticTurtle%2FpyVBAN","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheStaticTurtle%2FpyVBAN/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheStaticTurtle%2FpyVBAN/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheStaticTurtle%2FpyVBAN/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheStaticTurtle","download_url":"https://codeload.github.com/TheStaticTurtle/pyVBAN/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252996331,"owners_count":21837620,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-01T22:06:33.077Z","updated_at":"2025-05-08T03:54:06.970Z","avatar_url":"https://github.com/TheStaticTurtle.png","language":"Python","readme":"# pyVBAN\r\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pyVBAN)](https://pypi.org/project/pyVBAN/)\r\n\r\n\r\nPython implementation of the VBAN (VB Audio network) protocol\r\n\r\nOriginal specifications here: https://www.vb-audio.com/Voicemeeter/VBANProtocol_Specifications.pdf \r\n\r\nSupported sub-protocols:\r\n - [x] Audio\r\n - [x] Serial **(To verify)**\r\n - [x] Text \r\n - [ ] Service\r\n\r\nAs I'm currently not using VBAN nor VB-Audio products I have no plans to implement this further. \r\nI will do my best to maintain it!\r\n\r\nFor any feature request, the specs are open, feel free to open a PR 😀\r\n\r\n## Using the built-in utilities\r\n### List devices\r\n```bash\r\n$ python -m pyvban.utils.device_list\r\n```\r\n```python\r\nimport logging\r\nimport pyvban\r\nlogging.basicConfig(level=logging.DEBUG)\r\npyvban.utils.device_list()\r\n```\r\n\r\n### Receiver\r\n```bash\r\n$ python -m pyvban.utils.receiver --address 127.0.0.1 --port 6980 --stream Stream1 --device 11\r\n```\r\n```python\r\nimport logging\r\nimport pyvban\r\nlogging.basicConfig(level=logging.DEBUG)\r\nreceiver = pyvban.utils.VBAN_Receiver(\r\n    sender_ip=\"127.0.0.1\",\r\n    stream_name=\"Stream1\",\r\n    port=6980,\r\n    device_index=11\r\n)\r\nreceiver.run()\r\n```\r\n\r\n### Sender\r\n```bash\r\n$ python -m pyvban.utils.sender --address 127.0.0.1 --port 6980 --stream Stream1 --rate 48000 --channels 2 --device 1\r\n```\r\n```python\r\nimport logging\r\nimport pyvban\r\nlogging.basicConfig(level=logging.DEBUG)\r\nsender = pyvban.utils.VBAN_Sender(\r\n    receiver_ip=\"127.0.0.1\",\r\n    receiver_port=6980,\r\n    stream_name=\"Stream1\",\r\n    sample_rate=48000,\r\n    channels=2,\r\n    device_index=1\r\n)\r\nsender.run()\r\n```\r\n\r\n### Send text\r\n```bash\r\n$ python -m pyvban.utils.send_text --address 127.0.0.1 --port 6980 --stream Command1 \"Strip[5].Mute = 0\"\r\n```\r\n```python\r\nimport logging\r\nimport pyvban\r\nimport time\r\nlogging.basicConfig(level=logging.DEBUG)\r\nsend_text = pyvban.utils.VBAN_SendText(\r\n    receiver_ip=\"127.0.0.1\",\r\n    receiver_port=6980,\r\n    stream_name=\"Command1\"\r\n)\r\nstate = False\r\nwhile True:\r\n    state = not state\r\n    if state:\r\n        send_text.send(\"Strip[5].Mute = 0\")\r\n    else:\r\n        send_text.send(\"Strip[5].Mute = 1\")\r\n    time.sleep(1)\r\n```\r\n\r\n\r\n## Craft a packet manually\r\n\r\n```python\r\nimport pyvban\r\n\r\npcm_data = b\"\"  # 128 sample stereo data\r\nheader = pyvban.VBANAudioHeader(\r\n    sample_rate=pyvban.subprotocols.audio.VBANSampleRates.RATE_48000,\r\n    samples_per_frame=128,\r\n    channels=2,\r\n    format=pyvban.subprotocols.audio.VBANBitResolution.VBAN_BITFMT_16_INT,\r\n    codec=pyvban.subprotocols.audio.VBANCodec.VBAN_CODEC_PCM,\r\n    stream_name=\"Stream1\",\r\n    frame_counter=0,\r\n)\r\n\r\nvban_packet = header.to_bytes() + pcm_data\r\nvban_packet = vban_packet[:pyvban.const.VBAN_PROTOCOL_MAX_SIZE]\r\n```\r\n\r\n## Parse a packet manually\r\n```python\r\nimport pyvban\r\n\r\ndef run_once(self):\r\n    data, addr = socket.recvfrom(pyvban.const.VBAN_PROTOCOL_MAX_SIZE)\r\n    packet = pyvban.VBANPacket(data)\r\n    if packet.header:\r\n        if packet.header.sub_protocol != pyvban.const.VBANProtocols.VBAN_PROTOCOL_AUDIO:\r\n            print(f\"Received non audio packet {packet}\")\r\n            return\r\n        if packet.header.stream_name != self._stream_name:\r\n            print(f\"Unexpected stream name \\\"{packet.header.stream_name}\\\" != \\\"{self._stream_name}\\\"\")\r\n            return\r\n        if addr[0] != self._sender_ip:\r\n            print(f\"Unexpected sender \\\"{addr[0]}\\\" != \\\"{self._sender_ip}\\\"\")\r\n            return\r\n```\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthestaticturtle%2Fpyvban","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthestaticturtle%2Fpyvban","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthestaticturtle%2Fpyvban/lists"}