VBANTXT package with a CLI
Go to file
2024-11-07 19:34:44 +00:00
cmd/vbantxt move indexOf into the vbantxt package. 2024-11-03 16:15:05 +00:00
testdata add external vm/matrix tests 2024-11-03 15:47:03 +00:00
.gitignore add makefile 2024-11-03 15:47:59 +00:00
CHANGELOG.md add note about functional options to README 2024-11-03 15:54:34 +00:00
errors.go reorganise some of the internals of the package. 2024-11-03 15:46:14 +00:00
go.mod add makefile 2024-11-03 15:47:59 +00:00
go.sum add makefile 2024-11-03 15:47:59 +00:00
LICENSE Initial commit 2022-09-23 09:29:14 +01:00
makefile add makefile 2024-11-03 15:47:59 +00:00
option.go rename client struct to udpConn 2024-11-05 18:35:39 +00:00
packet.go header now uses reusable buffer 2024-11-07 19:34:44 +00:00
README.md fix default config.toml dir in README 2024-11-04 14:37:32 +00:00
udpconn.go rename client struct to udpConn 2024-11-05 18:35:39 +00:00
util.go move indexOf into the vbantxt package. 2024-11-03 16:15:05 +00:00
vbantxt_test.go add external vm/matrix tests 2024-11-03 15:47:03 +00:00
vbantxt.go rename client struct to udpConn 2024-11-05 18:35:39 +00:00

Windows Linux

VBAN Sendtext

Send Voicemeeter/Matrix vban requests.

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

Tested against

  • Basic 1.0.8.4
  • Banana 2.0.6.4
  • Potato 3.0.2.4
  • Matrix 1.0.0.3

Requirements

  • Voicemeeter or Matrix
  • Go 1.18 or greater (if you want to compile yourself, otherwise check Releases)

Use

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)
	}
}

Command Line

Pass host, port and streamname as flags, for example:

vbantxt -h="gamepc.local" -p=6980 -s=Command1 "strip[0].mute=1 strip[1].mono=1"

You may also store them in a config.toml located in home directory / .config / vbantxt /

A valid config.toml might look like this:

[connection]
host="gamepc.local"
port=6980
streamname="Command1"
  • host defaults to "localhost"
  • port defaults to 6980
  • streamname defaults to "Command1"

Command line flags will override values in a config.toml.


Script files

The vbantxt-cli utility 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:

cat script.txt | xargs vbantxt-cli

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 -s=streamname "Point(ASIO128.IN[2],ASIO128.OUT[1]).dBGain = -8"

Logging

Log level may be set by passing the -l flag with a number from 0 up to 6 where

0 = Panic, 1 = Fatal, 2 = Error, 3 = Warning, 4 = Info, 5 = Debug, 6 = Trace

Log level defaults to Warning level.