mirror of
https://github.com/onyx-and-iris/voicemeeter.git
synced 2026-04-18 13:33:30 +00:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| dd55dd8fdf | |||
|
|
00d0be8055 | ||
| 418d04a08e | |||
| 8038670203 | |||
| 3319a8c4f4 | |||
| b777025f88 | |||
| 93d5e2db67 | |||
| a23a9f8598 | |||
| 195ee326a0 |
@@ -1,4 +1,4 @@
|
|||||||
[](https://pkg.go.dev/github.com/onyx-and-iris/voicemeeter)
|
[](https://pkg.go.dev/github.com/onyx-and-iris/voicemeeter/v2)
|
||||||
|
|
||||||
# A Go Wrapper for Voicemeeter API
|
# A Go Wrapper for Voicemeeter API
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ Initialize your own module then `go get`
|
|||||||
|
|
||||||
```
|
```
|
||||||
go mod init github.com/x/y
|
go mod init github.com/x/y
|
||||||
go get github.com/onyx-and-iris/voicemeeter
|
go get github.com/onyx-and-iris/voicemeeter/v2
|
||||||
```
|
```
|
||||||
|
|
||||||
## `Use`
|
## `Use`
|
||||||
@@ -587,4 +587,4 @@ go test ./...
|
|||||||
|
|
||||||
### Official Documentation
|
### Official Documentation
|
||||||
|
|
||||||
- [Voicemeeter Remote C API](https://github.com/onyx-and-iris/Voicemeeter-SDK/blob/main/VoicemeeterRemoteAPI.pdf)
|
- [Voicemeeter Remote C API](https://github.com/onyx-and-iris/Voicemeeter-SDK/blob/update-docs/VoicemeeterRemoteAPI.pdf)
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ go 1.19
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/eiannone/keyboard v0.0.0-20220611211555-0d226195f203
|
github.com/eiannone/keyboard v0.0.0-20220611211555-0d226195f203
|
||||||
github.com/onyx-and-iris/voicemeeter v1.10.1
|
github.com/onyx-and-iris/voicemeeter/v2 v2.0.0
|
||||||
github.com/sirupsen/logrus v1.9.0
|
github.com/sirupsen/logrus v1.9.0
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
|
|||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/eiannone/keyboard v0.0.0-20220611211555-0d226195f203 h1:XBBHcIb256gUJtLmY22n99HaZTz+r2Z51xUPi01m3wg=
|
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/eiannone/keyboard v0.0.0-20220611211555-0d226195f203/go.mod h1:E1jcSv8FaEny+OP/5k9UxZVw9YFWGj7eI4KR/iOBqCg=
|
||||||
github.com/onyx-and-iris/voicemeeter v1.10.1 h1:kpPN/cTYe1JG2aLUD+/m/bMUbp7wXrqrk1fL+sV8yko=
|
github.com/onyx-and-iris/voicemeeter/v2 v2.0.0 h1:AXem+OMeKDuJd2KoLpzHEU70Rx2057p4XKgiOJkXCIo=
|
||||||
github.com/onyx-and-iris/voicemeeter v1.10.1/go.mod h1:LayUoN/MWSqKXSOGQ7AcLvwoefsL+zQ9CjncLs3WqsU=
|
github.com/onyx-and-iris/voicemeeter/v2 v2.0.0/go.mod h1:ULRO0N2Wg7Ymj7CEg4TI7CJobx9yVEZ5Lbh7oWi7woA=
|
||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
|
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ go 1.18
|
|||||||
require (
|
require (
|
||||||
github.com/BurntSushi/toml v1.2.0
|
github.com/BurntSushi/toml v1.2.0
|
||||||
github.com/andreykaipov/goobs v0.10.0
|
github.com/andreykaipov/goobs v0.10.0
|
||||||
github.com/onyx-and-iris/voicemeeter v1.10.1
|
github.com/onyx-and-iris/voicemeeter/v2 v2.0.0
|
||||||
github.com/sirupsen/logrus v1.9.0
|
github.com/sirupsen/logrus v1.9.0
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -13,8 +13,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/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 h1:VhgPp6v9qf9Agr/56bj7Y/xa04UccTW04VP0Qed4vnQ=
|
||||||
github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U=
|
github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U=
|
||||||
github.com/onyx-and-iris/voicemeeter v1.10.1 h1:kpPN/cTYe1JG2aLUD+/m/bMUbp7wXrqrk1fL+sV8yko=
|
github.com/onyx-and-iris/voicemeeter/v2 v2.0.0 h1:AXem+OMeKDuJd2KoLpzHEU70Rx2057p4XKgiOJkXCIo=
|
||||||
github.com/onyx-and-iris/voicemeeter v1.10.1/go.mod h1:LayUoN/MWSqKXSOGQ7AcLvwoefsL+zQ9CjncLs3WqsU=
|
github.com/onyx-and-iris/voicemeeter/v2 v2.0.0/go.mod h1:ULRO0N2Wg7Ymj7CEg4TI7CJobx9yVEZ5Lbh7oWi7woA=
|
||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
|
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
|
||||||
|
|||||||
@@ -20,8 +20,7 @@ func newObserver(vm *voicemeeter.Remote) *observer {
|
|||||||
return &observer{vm, make(chan string)}
|
return &observer{vm, make(chan string)}
|
||||||
}
|
}
|
||||||
|
|
||||||
// OnUpdate satisfies the observer interface defined in publisher.go
|
// Listen registers the observer channel and listens for updates.
|
||||||
// for each event type an action is triggered when the event occurs.
|
|
||||||
func (o observer) Listen() {
|
func (o observer) Listen() {
|
||||||
o.vm.Register(o.events)
|
o.vm.Register(o.events)
|
||||||
|
|
||||||
@@ -47,13 +46,14 @@ func init() {
|
|||||||
log.SetLevel(log.InfoLevel)
|
log.SetLevel(log.InfoLevel)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// runObserver initiates a single observer and
|
||||||
|
// starts its Listen() function in a goroutine.
|
||||||
func runObserver(vm *voicemeeter.Remote) {
|
func runObserver(vm *voicemeeter.Remote) {
|
||||||
o := newObserver(vm)
|
o := newObserver(vm)
|
||||||
go o.Listen()
|
go o.Listen()
|
||||||
}
|
}
|
||||||
|
|
||||||
// main connects to Voiceemeter, registers observer for updates
|
// main connects to Voiceemeter and runs a single observer for 30 seconds.
|
||||||
// runs updates for 30 seconds and then deregisters observer.
|
|
||||||
func main() {
|
func main() {
|
||||||
vm, err := vmConnect()
|
vm, err := vmConnect()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -67,6 +67,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// vmConnect connects to Voicemeeter potato and logs into the API
|
// vmConnect connects to Voicemeeter potato and logs into the API
|
||||||
|
// it also add ldirty to event updates.
|
||||||
func vmConnect() (*voicemeeter.Remote, error) {
|
func vmConnect() (*voicemeeter.Remote, error) {
|
||||||
vm, err := voicemeeter.NewRemote("basic", 0)
|
vm, err := voicemeeter.NewRemote("basic", 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
10
recorder.go
10
recorder.go
@@ -51,3 +51,13 @@ func (r *recorder) Rew() {
|
|||||||
func (r *recorder) Loop(val bool) {
|
func (r *recorder) Loop(val bool) {
|
||||||
r.setter_bool("Mode.Loop", val)
|
r.setter_bool("Mode.Loop", val)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Gain returns the value of the Gain parameter
|
||||||
|
func (r *recorder) Gain() float64 {
|
||||||
|
return r.getter_float("Gain")
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetGain sets the value of the Gain parameter
|
||||||
|
func (r *recorder) SetGain(val float64) {
|
||||||
|
r.setter_float("Gain", val)
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user