vbantxt

package module
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2026 License: MIT Imports: 7 Imported by: 0

README

Windows Linux macOS

VBAN Sendtext

Send Voicemeeter/Matrix vban requests.

For an outline of past/future changes refer to: CHANGELOG


Table of Contents

Requirements

Tested against

  • Basic 1.1.2.2
  • Banana 2.1.2.2
  • Potato 3.1.2.2
  • Matrix 1.0.2.6

VBANTXT Package

go get github.com/onyx-and-iris/vbantxt
package main

import (
	"log"

	"github.com/onyx-and-iris/vbantxt"
)

func main() {
	var (
		host       string = "vm.local"
		port       int    = 6980
		streamname string = "onyx"
	)

	client, err := vbantxt.New(host, port, streamname)
	if err != nil {
		log.Fatal(err)
	}
	defer client.Close()

	err = client.Send("strip[0].mute=0")
	if err != nil {
		_, _ = fmt.Fprintf(os.Stderr, "Error: %s", err)
		os.Exit(1)
	}
}

VBANTXT CLI

Installation
go install github.com/onyx-and-iris/vbantxt/cmd/vbantxt@latest
Use

Simply pass your vban commands as command line arguments:

vbantxt "strip[0].mute=1 strip[1].mono=1"
Configuration
Flags
FLAGS
  -H, --host STRING         VBAN host (default: localhost)
  -p, --port INT            VBAN port (default: 6980)
  -s, --streamname STRING   VBAN stream name (default: Command1)
  -b, --bps INT             VBAN BPS (default: 256000)
  -n, --channel INT         VBAN channel (default: 0)
  -r, --ratelimit INT       VBAN rate limit (ms) (default: 20)
  -C, --config STRING       Path to the configuration file (default: $XDG_CONFIG_HOME/vbantxt/config.toml)
  -l, --loglevel STRING     Log level (debug, info, warn, error, fatal, panic) (default: warn)
  -v, --version             Show version information
  -m, --man                 Print man page and exit

Pass --host, --port and --streamname as flags on the root command, for example:

vbantxt --host=localhost --port=6980 --streamname=Command1 --help
Environment Variables

All flags have corresponding environment variables, prefixed with VBANTXT_:

#!/usr/bin/env bash

export VBANTXT_HOST=localhost
export VBANTXT_PORT=6980
export VBANTXT_STREAMNAME=Command1

Flags will override environment variables.

TOML Config

By default the config loader will look for a config in:

  • $XDG_CONFIG_HOME / vbantxt / config.toml (see os.UserConfigDir)
    • A custom config path may be passed with the --config/-C flag.

All flags have corresponding keys in the config file, for example:

host="gamepc.local"
port=6980
streamname="Command1"

Script files

The vbantxt CLI accepts a single string request or an array of string requests. This means you can pass scripts stored in files.

For example, in Windows with Powershell you could:

vbantxt $(Get-Content .\script.txt)

Or with Bash:

xargs vbantxt < script.txt

to load commands from a file:

strip[0].mute=1;strip[0].mono=0
strip[1].mute=0;strip[1].mono=1
bus[3].eq.On=0

Matrix

Sending commands to VB-Audio Matrix is also possible, for example:

vbantxt "Point(ASIO128.IN[2],ASIO128.OUT[1]).dBGain = -8"

Logging

The --loglevel/-l flag allows you to control the verbosity of the application's logging output.

Acceptable values for this flag are:

  • debug
  • info
  • warn
  • error
  • fatal
  • panic

For example, to set the log level to debug, you can use:

vbantxt --loglevel=debug "bus[0].eq.on=1 bus[1].gain=-12.8"

The default log level is warn if the flag is not specified.

License

vbantxt is distributed under the terms of the MIT license.

Documentation

Overview

Package vbantxt provides utilities for handling VBAN text errors.

Index

Constants

This section is empty.

Variables

View Source
var BpsOpts = []int{
	0, 110, 150, 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 31250,
	38400, 57600, 115200, 128000, 230400, 250000, 256000, 460800, 921600,
	1000000, 1500000, 2000000, 3000000,
}

BpsOpts defines the available baud rate options.

Functions

This section is empty.

Types

type Error

type Error string

Error is used to define sentinel errors.

func (Error) Error

func (r Error) Error() string

Error implements the error interface.

type Option

type Option func(*VbanTxt)

Option is a functional option type that allows us to configure the VbanTxt.

func WithBPSOpt

func WithBPSOpt(bps int) Option

WithBPSOpt is a functional option to set the bps index for {VbanTxt}.packet.

func WithChannel

func WithChannel(channel int) Option

WithChannel is a functional option to set the channel for {VbanTxt}.packet.

func WithRateLimit

func WithRateLimit(ratelimit time.Duration) Option

WithRateLimit is a functional option to set the ratelimit for requests.

type VbanTxt

type VbanTxt struct {
	// contains filtered or unexported fields
}

VbanTxt is used to send VBAN-TXT requests to a distant Voicemeeter/Matrix.

func New

func New(host string, port int, streamname string, options ...Option) (*VbanTxt, error)

New constructs a fully formed VbanTxt instance. This is the package's entry point. It sets default values for it's fields and then runs the option functions.

func (*VbanTxt) Close

func (vt *VbanTxt) Close() error

Close is responsible for closing the UDP Client connection.

func (*VbanTxt) Send

func (vt *VbanTxt) Send(cmd string) error

Send is responsible for firing each VBAN-TXT request. It enforces rate limiting by waiting only when necessary.

Directories

Path Synopsis
cmd
vbantxt command
Package main implements a command-line tool for sending text messages over VBAN using the vbantxt library.
Package main implements a command-line tool for sending text messages over VBAN using the vbantxt library.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL