mirror of
https://github.com/onyx-and-iris/voicemeeter.git
synced 2026-04-18 05:23:31 +00:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
10d7cea523 | ||
|
|
8a9b5f9a97 | ||
|
|
8a611e39aa | ||
|
|
ff56dd16f5 | ||
|
|
440c3b8eec | ||
|
|
a5f653f569 | ||
|
|
73893209a1 | ||
|
|
303f1a871c |
@@ -1,4 +1,4 @@
|
||||
[](https://pkg.go.dev/github.com/onyx-and-iris/voicemeeter-api-go)
|
||||
[](https://pkg.go.dev/github.com/onyx-and-iris/voicemeeter)
|
||||
|
||||
# A Go Wrapper for Voicemeeter API
|
||||
|
||||
@@ -23,7 +23,7 @@ For an outline of past/future changes refer to: [CHANGELOG](CHANGELOG.md)
|
||||
|
||||
Install voicemeeter-api-go package from your console to download the latest version.
|
||||
|
||||
`go get github.com/onyx-and-iris/voicemeeter-api-go`
|
||||
`go get github.com/onyx-and-iris/voicemeeter`
|
||||
|
||||
or add it to your `go.mod` file.
|
||||
|
||||
@@ -38,7 +38,7 @@ import (
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"github.com/onyx-and-iris/voicemeeter-api-go"
|
||||
"github.com/onyx-and-iris/voicemeeter"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -4,7 +4,7 @@ go 1.19
|
||||
|
||||
require (
|
||||
github.com/eiannone/keyboard v0.0.0-20220611211555-0d226195f203
|
||||
github.com/onyx-and-iris/voicemeeter-api-go v1.7.0
|
||||
github.com/onyx-and-iris/voicemeeter-api-go v1.8.0
|
||||
)
|
||||
|
||||
require golang.org/x/sys v0.0.0-20220708085239-5a0f0661e09d // indirect
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/eiannone/keyboard v0.0.0-20220611211555-0d226195f203 h1:XBBHcIb256gUJtLmY22n99HaZTz+r2Z51xUPi01m3wg=
|
||||
github.com/eiannone/keyboard v0.0.0-20220611211555-0d226195f203/go.mod h1:E1jcSv8FaEny+OP/5k9UxZVw9YFWGj7eI4KR/iOBqCg=
|
||||
github.com/onyx-and-iris/voicemeeter-api-go v1.7.0 h1:WA1RGrfaWBOavgY2uoJltzy/rAgvs62PM3qzR+5/jt8=
|
||||
github.com/onyx-and-iris/voicemeeter-api-go v1.7.0/go.mod h1:zAdBhHXQ9n37CUbLizbOPmAutyZI8Ncqeu5e9u1Fy14=
|
||||
github.com/onyx-and-iris/voicemeeter-api-go v1.8.0 h1:uVeKXG3+dnZUakJNZ0RjYFgVhFCzGPoiNnU32LqGR4Y=
|
||||
github.com/onyx-and-iris/voicemeeter-api-go v1.8.0/go.mod h1:zAdBhHXQ9n37CUbLizbOPmAutyZI8Ncqeu5e9u1Fy14=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
|
||||
golang.org/x/sys v0.0.0-20220708085239-5a0f0661e09d h1:/m5NbqQelATgoSPVC2Z23sR4kVNokFwDDyWh/3rGY+I=
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"log"
|
||||
|
||||
"github.com/eiannone/keyboard"
|
||||
"github.com/onyx-and-iris/voicemeeter-api-go"
|
||||
"github.com/onyx-and-iris/voicemeeter"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -5,7 +5,7 @@ go 1.18
|
||||
require (
|
||||
github.com/BurntSushi/toml v1.2.0
|
||||
github.com/andreykaipov/goobs v0.10.0
|
||||
github.com/onyx-and-iris/voicemeeter-api-go v1.7.0
|
||||
github.com/onyx-and-iris/voicemeeter-api-go v1.8.0
|
||||
)
|
||||
|
||||
require (
|
||||
|
||||
@@ -11,8 +11,8 @@ github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI
|
||||
github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64=
|
||||
github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d h1:VhgPp6v9qf9Agr/56bj7Y/xa04UccTW04VP0Qed4vnQ=
|
||||
github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U=
|
||||
github.com/onyx-and-iris/voicemeeter-api-go v1.7.0 h1:WA1RGrfaWBOavgY2uoJltzy/rAgvs62PM3qzR+5/jt8=
|
||||
github.com/onyx-and-iris/voicemeeter-api-go v1.7.0/go.mod h1:zAdBhHXQ9n37CUbLizbOPmAutyZI8Ncqeu5e9u1Fy14=
|
||||
github.com/onyx-and-iris/voicemeeter-api-go v1.8.0 h1:uVeKXG3+dnZUakJNZ0RjYFgVhFCzGPoiNnU32LqGR4Y=
|
||||
github.com/onyx-and-iris/voicemeeter-api-go v1.8.0/go.mod h1:zAdBhHXQ9n37CUbLizbOPmAutyZI8Ncqeu5e9u1Fy14=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk=
|
||||
golang.org/x/sys v0.0.0-20220708085239-5a0f0661e09d h1:/m5NbqQelATgoSPVC2Z23sR4kVNokFwDDyWh/3rGY+I=
|
||||
|
||||
@@ -3,10 +3,10 @@ package main
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"time"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/onyx-and-iris/voicemeeter-api-go"
|
||||
"github.com/onyx-and-iris/voicemeeter"
|
||||
|
||||
"github.com/andreykaipov/goobs"
|
||||
"github.com/andreykaipov/goobs/api/events"
|
||||
@@ -107,7 +107,8 @@ func obsConnect() (*goobs.Client, error) {
|
||||
|
||||
f := "config.toml"
|
||||
if _, err := os.Stat(f); err != nil {
|
||||
f = "./config.toml"
|
||||
err := fmt.Errorf("unable to locate %s", f)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var c config
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/onyx-and-iris/voicemeeter-api-go"
|
||||
"github.com/onyx-and-iris/voicemeeter"
|
||||
)
|
||||
|
||||
// observer represents a single receiver of updates
|
||||
|
||||
@@ -5,8 +5,10 @@ A simple voicemeeter-cli program. Offers ability to toggle, get and set paramete
|
||||
## Use
|
||||
|
||||
Toggle with `!` prefix, get by excluding `=` and set by including `=`. Mix and match arguments.
|
||||
|
||||
You may pass an optional flag -kind to set the kind of Voicemeeter. Defaults to banana.
|
||||
You may pass an optional flag -delay to set a delay on the getters. Defaults to 15ms.
|
||||
|
||||
You may pass an optional flag -delay to set a delay on the getters. Defaults to 20ms.
|
||||
|
||||
for example:
|
||||
|
||||
|
||||
@@ -6,12 +6,12 @@ import (
|
||||
"log"
|
||||
"strings"
|
||||
|
||||
"github.com/onyx-and-iris/voicemeeter-api-go"
|
||||
"github.com/onyx-and-iris/voicemeeter"
|
||||
)
|
||||
|
||||
func main() {
|
||||
kindId := flag.String("kind", "banana", "kind of voicemeeter")
|
||||
delay := flag.Int("delay", 15, "delay between commands")
|
||||
delay := flag.Int("delay", 20, "delay between commands")
|
||||
flag.Parse()
|
||||
|
||||
vm, err := vmConnect(kindId, delay)
|
||||
@@ -20,7 +20,7 @@ func main() {
|
||||
}
|
||||
defer vm.Logout()
|
||||
|
||||
err = run_commands(vm)
|
||||
err = runCommands(vm)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
}
|
||||
@@ -40,7 +40,7 @@ func vmConnect(kindId *string, delay *int) (*voicemeeter.Remote, error) {
|
||||
return vm, nil
|
||||
}
|
||||
|
||||
func run_commands(vm *voicemeeter.Remote) error {
|
||||
func runCommands(vm *voicemeeter.Remote) error {
|
||||
for _, arg := range flag.Args() {
|
||||
if arg[0] == '!' {
|
||||
val, err := vm.GetFloat(arg[1:])
|
||||
@@ -59,16 +59,16 @@ func run_commands(vm *voicemeeter.Remote) error {
|
||||
return err
|
||||
}
|
||||
} else {
|
||||
val_f, err := vm.GetFloat(arg)
|
||||
valF, err := vm.GetFloat(arg)
|
||||
if err != nil {
|
||||
val_s, err := vm.GetString(arg)
|
||||
valS, err := vm.GetString(arg)
|
||||
if err != nil {
|
||||
err = fmt.Errorf("unable to get %s", arg)
|
||||
return err
|
||||
}
|
||||
fmt.Println("Value of", arg, "is:", val_s)
|
||||
fmt.Println("Value of", arg, "is:", valS)
|
||||
} else {
|
||||
fmt.Println("Value of", arg, "is:", val_f)
|
||||
fmt.Println("Value of", arg, "is:", valF)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
8
go.mod
8
go.mod
@@ -1,11 +1,9 @@
|
||||
module github.com/onyx-and-iris/voicemeeter-api-go
|
||||
module github.com/onyx-and-iris/voicemeeter
|
||||
|
||||
go 1.18
|
||||
|
||||
retract (
|
||||
// package files moved into root of repository
|
||||
[v1.0.0, v1.1.0]
|
||||
)
|
||||
// package files moved into root of repository
|
||||
retract [v1.0.0, v1.1.0]
|
||||
|
||||
require (
|
||||
github.com/stretchr/testify v1.8.0
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"log"
|
||||
"testing"
|
||||
|
||||
"github.com/onyx-and-iris/voicemeeter-api-go"
|
||||
"github.com/onyx-and-iris/voicemeeter"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
Reference in New Issue
Block a user