mirror of
https://github.com/onyx-and-iris/vbantxt.git
synced 2026-04-20 16:03:35 +00:00
Compare commits
5 Commits
add-load-f
...
9a15ad98a8
| Author | SHA1 | Date | |
|---|---|---|---|
| 9a15ad98a8 | |||
| b8fa4d5be0 | |||
| 64c1cb8fbe | |||
| eeb789003b | |||
| 4fd190bc4e |
@@ -15,14 +15,14 @@ Before any major/minor/patch bump all unit tests will be run to verify they pass
|
||||
|
||||
### Added
|
||||
|
||||
- it's now possible to load configuration from environment variables. See [Environment Variables]()
|
||||
- it's now possible to load configuration from environment variables. See [Environment Variables](https://github.com/onyx-and-iris/vbantxt/tree/main?tab=readme-ov-file#environment-variables)
|
||||
- --version/-v command
|
||||
|
||||
### Changed
|
||||
|
||||
- shortname for --host flag is now -H.
|
||||
- shortname for --channel flag is now -n.
|
||||
- toml loader no longer requires a `[connection]` table. See [TOML Config]()
|
||||
- toml loader no longer requires a `[connection]` table. See [TOML Config](https://github.com/onyx-and-iris/vbantxt/tree/main?tab=readme-ov-file#toml-config)
|
||||
|
||||
|
||||
# [0.4.1] - 2025-04-05
|
||||
|
||||
78
README.md
78
README.md
@@ -7,23 +7,37 @@ Send Voicemeeter/Matrix vban requests.
|
||||
|
||||
For an outline of past/future changes refer to: [CHANGELOG](CHANGELOG.md)
|
||||
|
||||
## Tested against
|
||||
---
|
||||
|
||||
- Basic 1.1.1.8
|
||||
- Banana 2.1.1.8
|
||||
- Potato 3.1.1.8
|
||||
- Matrix 1.0.1.2
|
||||
## Table of Contents
|
||||
|
||||
- [Installation](#installation)
|
||||
- [VBANTXT Package](#vbantxt-package)
|
||||
- [VBANTXT CLI](#vbantxt-cli)
|
||||
- [License](#license)
|
||||
|
||||
## Requirements
|
||||
|
||||
- [Voicemeeter](https://voicemeeter.com/) or [Matrix](https://vb-audio.com/Matrix/)
|
||||
- Go 1.18 or greater (if you want to compile yourself, otherwise check `Releases`)
|
||||
- Go 1.18 or greater (a binary is available in [Releases](https://github.com/onyx-and-iris/vbantxt/releases))
|
||||
|
||||
## Tested against
|
||||
|
||||
- Basic 1.1.1.9
|
||||
- Banana 2.1.1.9
|
||||
- Potato 3.1.1.9
|
||||
- Matrix 1.0.1.2
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
```console
|
||||
go get github.com/onyx-and-iris/vbantxt
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## `Use`
|
||||
|
||||
`go get github.com/onyx-and-iris/vbantxt`
|
||||
## `VBANTXT Package`
|
||||
|
||||
```go
|
||||
package main
|
||||
@@ -55,35 +69,49 @@ func main() {
|
||||
}
|
||||
```
|
||||
|
||||
## `Command Line`
|
||||
## `VBANTXT CLI`
|
||||
|
||||
### Use
|
||||
|
||||
Simply pass your vban commands as commane line arguments:
|
||||
|
||||
```console
|
||||
vbantxt "strip[0].mute=1 strip[1].mono=1"
|
||||
```
|
||||
|
||||
### Configuration
|
||||
|
||||
#### Flags
|
||||
|
||||
- --host/-H: defaults to localhost
|
||||
- --port/-p: defaults to 6980
|
||||
- --streamname/-s: defaults to Command1
|
||||
- --config/-C: defaults to `$XDG_CONFIG_HOME / vbantxt / config.toml`
|
||||
- --loglevel/-l: defaults to warn
|
||||
- --version/-v: print the vbantxt version and exit
|
||||
```console
|
||||
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
|
||||
```
|
||||
|
||||
For example:
|
||||
Pass --host, --port and --streamname as flags on the root command, for example:
|
||||
|
||||
```console
|
||||
vbantxt --host="gamepc.local" --port=6980 --streamname=Command1 "strip[0].mute=1 strip[1].mono=1"
|
||||
vbantxt --host=localhost --port=6980 --streamname=Command1 --help
|
||||
```
|
||||
|
||||
#### Environment Variables
|
||||
|
||||
Load the following values from your environment:
|
||||
All flags have corresponding environment variables, prefixed with `VBANTXT_`:
|
||||
|
||||
```bash
|
||||
#!/usr/bin/env bash
|
||||
|
||||
export VBANTXT_HOST=localhost
|
||||
export VBANTXT_PORT=6980
|
||||
export VBANTXT_STREAMNAME=onyx
|
||||
export VBANTXT_STREAMNAME=Command1
|
||||
```
|
||||
|
||||
Flags will override environment variables.
|
||||
@@ -93,8 +121,9 @@ Flags will override environment variables.
|
||||
By default the config loader will look for a config in:
|
||||
|
||||
- $XDG_CONFIG_HOME / vbantxt / config.toml (see [os.UserConfigDir](https://pkg.go.dev/os#UserConfigDir))
|
||||
- A custom config path may be passed with the --config/-C flag.
|
||||
|
||||
A valid config.toml might look like this:
|
||||
All flags have corresponding keys in the config file, for example:
|
||||
|
||||
```toml
|
||||
host="gamepc.local"
|
||||
@@ -102,8 +131,6 @@ port=6980
|
||||
streamname="Command1"
|
||||
```
|
||||
|
||||
A custom config path may be passed with the --config/-C flag.
|
||||
|
||||
---
|
||||
|
||||
## `Script files`
|
||||
@@ -162,3 +189,8 @@ 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](https://spdx.org/licenses/MIT.html) license.
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"bufio"
|
||||
"bytes"
|
||||
_ "embed"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/onyx-and-iris/vbantxt"
|
||||
@@ -28,14 +29,14 @@ func run(t *testing.T, client *vbantxt.VbanTxt, script []byte) {
|
||||
}
|
||||
|
||||
func TestSendVm(t *testing.T) {
|
||||
client, err := vbantxt.New("localhost", 6980, "onyx")
|
||||
client, err := vbantxt.New(os.Getenv("VBANTXT_HOST"), 6980, os.Getenv("VBANTXT_STREAMNAME"))
|
||||
require.NoError(t, err)
|
||||
|
||||
run(t, client, vm)
|
||||
}
|
||||
|
||||
func TestSendMatrix(t *testing.T) {
|
||||
client, err := vbantxt.New("localhost", 6990, "onyx")
|
||||
client, err := vbantxt.New(os.Getenv("VBANTXT_HOST"), 6990, os.Getenv("VBANTXT_STREAMNAME"))
|
||||
require.NoError(t, err)
|
||||
|
||||
run(t, client, matrix)
|
||||
|
||||
Reference in New Issue
Block a user