mirror of
https://github.com/onyx-and-iris/voicemeeter.git
synced 2026-04-19 22:13:31 +00:00
Compare commits
11 Commits
v2.0.0
...
07018d1703
| Author | SHA1 | Date | |
|---|---|---|---|
| 07018d1703 | |||
| 73627ddbf1 | |||
| dd55dd8fdf | |||
|
|
00d0be8055 | ||
| 418d04a08e | |||
| 8038670203 | |||
| 3319a8c4f4 | |||
| b777025f88 | |||
| 93d5e2db67 | |||
| a23a9f8598 | |||
| 195ee326a0 |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -19,3 +19,7 @@ config.toml
|
||||
|
||||
# Dependency directories (remove the comment below to include it)
|
||||
# vendor/
|
||||
|
||||
# work files
|
||||
go.work
|
||||
go.work.sum
|
||||
338
README.md
338
README.md
@@ -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
|
||||
|
||||
@@ -8,14 +8,14 @@ For an outline of past/future changes refer to: [CHANGELOG](CHANGELOG.md)
|
||||
|
||||
## Tested against
|
||||
|
||||
- Basic 1.0.8.8
|
||||
- Banana 2.0.6.8
|
||||
- Potato 3.0.2.8
|
||||
- Basic 1.0.8.8
|
||||
- Banana 2.0.6.8
|
||||
- Potato 3.0.2.8
|
||||
|
||||
## Requirements
|
||||
|
||||
- [Voicemeeter](https://voicemeeter.com/)
|
||||
- Go 1.18 or greater
|
||||
- [Voicemeeter](https://voicemeeter.com/)
|
||||
- Go 1.18 or greater
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -23,7 +23,7 @@ Initialize your own module then `go get`
|
||||
|
||||
```
|
||||
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`
|
||||
@@ -73,9 +73,9 @@ func vmConnect() (*voicemeeter.Remote, error) {
|
||||
|
||||
Pass the kind of Voicemeeter as an argument. kindId may be:
|
||||
|
||||
- `basic`
|
||||
- `banana`
|
||||
- `potato`
|
||||
- `basic`
|
||||
- `banana`
|
||||
- `potato`
|
||||
|
||||
### `delay`
|
||||
|
||||
@@ -179,28 +179,28 @@ Use this to force dirty parameters to clear after a delay in milliseconds.
|
||||
|
||||
The following methods are available
|
||||
|
||||
- `Mute() bool`
|
||||
- `SetMute(val bool)`
|
||||
- `Mono() bool`
|
||||
- `SetMono(val bool)`
|
||||
- `Solo() bool`
|
||||
- `SetSolo(val bool)`
|
||||
- `Limit() int`
|
||||
- `SetLimit(val int)` from -40 to 12
|
||||
- `Label() string`
|
||||
- `SetLabel(val string)`
|
||||
- `Gain() float64`
|
||||
- `SetGain(val float64)` from -60.0 to 12.0
|
||||
- `Mc() bool`
|
||||
- `SetMc(val bool)`
|
||||
- `Audibility() float64`
|
||||
- `SetAudibility(val float64)` from 0.0 to 10.0
|
||||
- `A1() bool - A5() bool`
|
||||
- `SetA1(val bool) - SetA5(val bool)`
|
||||
- `B1() bool - B3() bool`
|
||||
- `SetB1(val bool) bool - SetB3(val bool) bool`
|
||||
- `AppGain(name string, gain float64)`
|
||||
- `AppMute(name string, val bool)`
|
||||
- `Mute() bool`
|
||||
- `SetMute(val bool)`
|
||||
- `Mono() bool`
|
||||
- `SetMono(val bool)`
|
||||
- `Solo() bool`
|
||||
- `SetSolo(val bool)`
|
||||
- `Limit() int`
|
||||
- `SetLimit(val int)` from -40 to 12
|
||||
- `Label() string`
|
||||
- `SetLabel(val string)`
|
||||
- `Gain() float64`
|
||||
- `SetGain(val float64)` from -60.0 to 12.0
|
||||
- `Mc() bool`
|
||||
- `SetMc(val bool)`
|
||||
- `Audibility() float64`
|
||||
- `SetAudibility(val float64)` from 0.0 to 10.0
|
||||
- `A1() bool - A5() bool`
|
||||
- `SetA1(val bool) - SetA5(val bool)`
|
||||
- `B1() bool - B3() bool`
|
||||
- `SetB1(val bool) bool - SetB3(val bool) bool`
|
||||
- `AppGain(name string, gain float64)`
|
||||
- `AppMute(name string, val bool)`
|
||||
|
||||
example:
|
||||
|
||||
@@ -215,28 +215,28 @@ vm.Strip[5].AppMute("Spotify", true)
|
||||
|
||||
##### Comp
|
||||
|
||||
- `vm.Strip[i].Comp()`
|
||||
- `vm.Strip[i].Comp()`
|
||||
|
||||
The following methods are available
|
||||
|
||||
- `Knob() float64`
|
||||
- `SetKnob(val float64)` from 0.0 to 10.0
|
||||
- `GainIn() float64`
|
||||
- `SetGainIn(val float64)` from -24.0 to 24.0
|
||||
- `Ratio() float64`
|
||||
- `SetRatio(val float64)` from 1.0 to 8.0
|
||||
- `Threshold() float64`
|
||||
- `SetThreshold(val float64)` from -40.0 to -3.0
|
||||
- `Attack() float64`
|
||||
- `SetAttack(val float64)` from 0.0 to 200.0
|
||||
- `Release() float64`
|
||||
- `SetRelease(val float64)` from 0.0 to 5000.0
|
||||
- `Knee() float64`
|
||||
- `SetKnee(val float64)` from 0.0 to 1.0
|
||||
- `GainOut() float64`
|
||||
- `SetGainOut(val float64)` from -24.0 to 24.0
|
||||
- `MakeUp() bool`
|
||||
- `SetMakeUp(val bool)`
|
||||
- `Knob() float64`
|
||||
- `SetKnob(val float64)` from 0.0 to 10.0
|
||||
- `GainIn() float64`
|
||||
- `SetGainIn(val float64)` from -24.0 to 24.0
|
||||
- `Ratio() float64`
|
||||
- `SetRatio(val float64)` from 1.0 to 8.0
|
||||
- `Threshold() float64`
|
||||
- `SetThreshold(val float64)` from -40.0 to -3.0
|
||||
- `Attack() float64`
|
||||
- `SetAttack(val float64)` from 0.0 to 200.0
|
||||
- `Release() float64`
|
||||
- `SetRelease(val float64)` from 0.0 to 5000.0
|
||||
- `Knee() float64`
|
||||
- `SetKnee(val float64)` from 0.0 to 1.0
|
||||
- `GainOut() float64`
|
||||
- `SetGainOut(val float64)` from -24.0 to 24.0
|
||||
- `MakeUp() bool`
|
||||
- `SetMakeUp(val bool)`
|
||||
|
||||
example:
|
||||
|
||||
@@ -246,24 +246,24 @@ vm.Strip[3].Comp().SetRatio(3.5)
|
||||
|
||||
##### Gate
|
||||
|
||||
- `vm.Strip[i].Gate()`
|
||||
- `vm.Strip[i].Gate()`
|
||||
|
||||
The following methods are available
|
||||
|
||||
- `Knob() float64`
|
||||
- `SetKnob(val float64)` from 0.0 to 10.0
|
||||
- `Threshold() float64`
|
||||
- `SetThreshold(val float64)` from -60.0 to -10.0
|
||||
- `Damping() float64`
|
||||
- `SetDamping(val float64)` from -60.0 to -10.0
|
||||
- `BPSidechain() int`
|
||||
- `SetBPSidechain(val int)` from 100 to 4000
|
||||
- `Attack() float64`
|
||||
- `SetAttack(val float64)` from 0.0 to 1000.0
|
||||
- `Hold() float64`
|
||||
- `SetHold(val float64)` from 0.0 to 5000.0
|
||||
- `Release() float64`
|
||||
- `SetRelease(val float64)` from 0.0 to 5000.0
|
||||
- `Knob() float64`
|
||||
- `SetKnob(val float64)` from 0.0 to 10.0
|
||||
- `Threshold() float64`
|
||||
- `SetThreshold(val float64)` from -60.0 to -10.0
|
||||
- `Damping() float64`
|
||||
- `SetDamping(val float64)` from -60.0 to -10.0
|
||||
- `BPSidechain() int`
|
||||
- `SetBPSidechain(val int)` from 100 to 4000
|
||||
- `Attack() float64`
|
||||
- `SetAttack(val float64)` from 0.0 to 1000.0
|
||||
- `Hold() float64`
|
||||
- `SetHold(val float64)` from 0.0 to 5000.0
|
||||
- `Release() float64`
|
||||
- `SetRelease(val float64)` from 0.0 to 5000.0
|
||||
|
||||
example:
|
||||
|
||||
@@ -273,12 +273,12 @@ fmt.Println(vm.Strip[4].Gate().Attack())
|
||||
|
||||
##### Denoiser
|
||||
|
||||
- `vm.Strip[i].Denoiser()`
|
||||
- `vm.Strip[i].Denoiser()`
|
||||
|
||||
The following methods are available
|
||||
|
||||
- `Knob() float64`
|
||||
- `SetKnob(val float64)` from 0.0 to 10.0
|
||||
- `Knob() float64`
|
||||
- `SetKnob(val float64)` from 0.0 to 10.0
|
||||
|
||||
example:
|
||||
|
||||
@@ -288,12 +288,12 @@ vm.Strip[1].Denoiser().SetKnob(4.2)
|
||||
|
||||
##### Gainlayer
|
||||
|
||||
- `vm.Strip[i].Gainlayer()[j]`
|
||||
- `vm.Strip[i].Gainlayer()[j]`
|
||||
|
||||
The following methods are available
|
||||
|
||||
- `Get() float64`
|
||||
- `Set(val float64)`
|
||||
- `Get() float64`
|
||||
- `Set(val float64)`
|
||||
|
||||
example:
|
||||
|
||||
@@ -303,13 +303,13 @@ vm.Strip[6].GainLayer()[3].Set(-13.6)
|
||||
|
||||
##### Levels
|
||||
|
||||
- `vm.Strip[i].Levels()`
|
||||
- `vm.Strip[i].Levels()`
|
||||
|
||||
The following methods are available
|
||||
|
||||
- `PreFader() []float64`
|
||||
- `PostFader() []float64`
|
||||
- `PostMute() []float64`
|
||||
- `PreFader() []float64`
|
||||
- `PostFader() []float64`
|
||||
- `PostMute() []float64`
|
||||
|
||||
example:
|
||||
|
||||
@@ -321,15 +321,15 @@ fmt.Println(vm.Strip[5].Levels().PreFader())
|
||||
|
||||
The following methods are available
|
||||
|
||||
- `String() string`
|
||||
- `Mute() bool`
|
||||
- `SetMute(val bool)`
|
||||
- `Mono() bool`
|
||||
- `SetMono(val bool)`
|
||||
- `Label() string`
|
||||
- `SetLabel(val string)`
|
||||
- `Gain() float64`
|
||||
- `SetGain(val float64)` from -60.0 to 12.0
|
||||
- `String() string`
|
||||
- `Mute() bool`
|
||||
- `SetMute(val bool)`
|
||||
- `Mono() bool`
|
||||
- `SetMono(val bool)`
|
||||
- `Label() string`
|
||||
- `SetLabel(val string)`
|
||||
- `Gain() float64`
|
||||
- `SetGain(val float64)` from -60.0 to 12.0
|
||||
|
||||
example:
|
||||
|
||||
@@ -340,34 +340,34 @@ fmt.Println(vm.Bus[0].Label())
|
||||
|
||||
##### Modes
|
||||
|
||||
- `vm.Bus[i].Mode()`
|
||||
- `vm.Bus[i].Mode()`
|
||||
|
||||
The following methods are available
|
||||
|
||||
- `SetNormal(val bool)`
|
||||
- `Normal() bool`
|
||||
- `SetAmix(val bool)`
|
||||
- `Amix() bool`
|
||||
- `SetBmix(val bool)`
|
||||
- `Bmix() bool`
|
||||
- `SetRepeat(val bool)`
|
||||
- `Repeat() bool`
|
||||
- `SetComposite(val bool)`
|
||||
- `Composite() bool`
|
||||
- `SetTvMix(val bool)`
|
||||
- `TvMix() bool`
|
||||
- `SetUpMix21(val bool)`
|
||||
- `UpMix21() bool`
|
||||
- `SetUpMix41(val bool)`
|
||||
- `UpMix41() bool`
|
||||
- `SetUpMix61(val bool)`
|
||||
- `UpMix61() bool`
|
||||
- `SetCenterOnly(val bool)`
|
||||
- `CenterOnly() bool`
|
||||
- `SetLfeOnly(val bool)`
|
||||
- `LfeOnly() bool`
|
||||
- `SetRearOnly(val bool)`
|
||||
- `RearOnly() bool`
|
||||
- `SetNormal(val bool)`
|
||||
- `Normal() bool`
|
||||
- `SetAmix(val bool)`
|
||||
- `Amix() bool`
|
||||
- `SetBmix(val bool)`
|
||||
- `Bmix() bool`
|
||||
- `SetRepeat(val bool)`
|
||||
- `Repeat() bool`
|
||||
- `SetComposite(val bool)`
|
||||
- `Composite() bool`
|
||||
- `SetTvMix(val bool)`
|
||||
- `TvMix() bool`
|
||||
- `SetUpMix21(val bool)`
|
||||
- `UpMix21() bool`
|
||||
- `SetUpMix41(val bool)`
|
||||
- `UpMix41() bool`
|
||||
- `SetUpMix61(val bool)`
|
||||
- `UpMix61() bool`
|
||||
- `SetCenterOnly(val bool)`
|
||||
- `CenterOnly() bool`
|
||||
- `SetLfeOnly(val bool)`
|
||||
- `LfeOnly() bool`
|
||||
- `SetRearOnly(val bool)`
|
||||
- `RearOnly() bool`
|
||||
|
||||
example:
|
||||
|
||||
@@ -378,11 +378,11 @@ vm.Bus[4].Mode().SetCenterOnly(true)
|
||||
|
||||
##### Levels
|
||||
|
||||
- `vm.Bus[i].Levels()`
|
||||
- `vm.Bus[i].Levels()`
|
||||
|
||||
The following methods are available
|
||||
|
||||
- `All() []float64`
|
||||
- `All() []float64`
|
||||
|
||||
example:
|
||||
|
||||
@@ -394,14 +394,14 @@ fmt.Println(vm.Bus[1].Levels().All())
|
||||
|
||||
##### EQ
|
||||
|
||||
- `vm.Strip[i].Eq()` `vm.Bus[i].Eq()`
|
||||
- `vm.Strip[i].Eq()` `vm.Bus[i].Eq()`
|
||||
|
||||
The following methods are available.
|
||||
|
||||
- `On() bool`
|
||||
- `SetOn(val bool)`
|
||||
- `Ab() bool`
|
||||
- `SetAb(val bool)`
|
||||
- `On() bool`
|
||||
- `SetOn(val bool)`
|
||||
- `Ab() bool`
|
||||
- `SetAb(val bool)`
|
||||
|
||||
example:
|
||||
|
||||
@@ -412,8 +412,8 @@ fmt.Println(vm.Bus[3].Eq().Ab())
|
||||
|
||||
The following methods are available.
|
||||
|
||||
- `FadeTo(target float64, time_ int)`: float, int
|
||||
- `FadeBy(change float64, time_ int)`: float, int
|
||||
- `FadeTo(target float64, time_ int)`: float, int
|
||||
- `FadeBy(change float64, time_ int)`: float, int
|
||||
|
||||
Modify gain to or by the selected amount in db over a time interval in ms.
|
||||
|
||||
@@ -428,12 +428,12 @@ vm.Bus[3].FadeTo(-12.8, 500)
|
||||
|
||||
The following methods are available
|
||||
|
||||
- `State() bool`
|
||||
- `SetState(val bool)`
|
||||
- `StateOnly() bool`
|
||||
- `SetStateOnly(val bool)`
|
||||
- `Trigger() bool`
|
||||
- `SetTrigger(val bool)`
|
||||
- `State() bool`
|
||||
- `SetState(val bool)`
|
||||
- `StateOnly() bool`
|
||||
- `SetStateOnly(val bool)`
|
||||
- `Trigger() bool`
|
||||
- `SetTrigger(val bool)`
|
||||
|
||||
example:
|
||||
|
||||
@@ -446,11 +446,11 @@ fmt.Println(vm.Button[64].StateOnly())
|
||||
|
||||
The following methods are available
|
||||
|
||||
- `Show()` Show Voicemeeter GUI if it's hidden
|
||||
- `Hide()` Hide Voicemeeter GUI if it's shown
|
||||
- `Shutdown()` Shuts down the GUI
|
||||
- `Restart()` Restart the audio engine
|
||||
- `Lock(val bool)` Lock the Voicemeeter GUI
|
||||
- `Show()` Show Voicemeeter GUI if it's hidden
|
||||
- `Hide()` Hide Voicemeeter GUI if it's shown
|
||||
- `Shutdown()` Shuts down the GUI
|
||||
- `Restart()` Restart the audio engine
|
||||
- `Lock(val bool)` Lock the Voicemeeter GUI
|
||||
|
||||
example:
|
||||
|
||||
@@ -461,32 +461,32 @@ vm.Command.Show()
|
||||
|
||||
### VBAN
|
||||
|
||||
- `vm.Vban.Enable()` `vm.Vban.Disable()` Turn VBAN on or off
|
||||
- `vm.Vban.Enable()` `vm.Vban.Disable()` Turn VBAN on or off
|
||||
|
||||
##### Instream | Outstream
|
||||
|
||||
- `vm.Vban.InStream[i]` `vm.Vban.OutStream[i]`
|
||||
- `vm.Vban.InStream[i]` `vm.Vban.OutStream[i]`
|
||||
|
||||
The following methods are available
|
||||
|
||||
- `On() bool`
|
||||
- `SetOn(val bool)`
|
||||
- `Name() string`
|
||||
- `SetName(val string)`
|
||||
- `Ip() string`
|
||||
- `SetIp(val string)`
|
||||
- `Port() int`
|
||||
- `SetPort(val int)` from 1024 to 65535
|
||||
- `Sr() int`
|
||||
- `SetSr(val int)` (11025, 16000, 22050, 24000, 32000, 44100, 48000, 64000, 88200, 96000)
|
||||
- `Channel() int`
|
||||
- `SetChannel(val int)` from 1 to 8
|
||||
- `Bit() int`
|
||||
- `SetBit(val int)` 16 or 24
|
||||
- `Quality() int`
|
||||
- `SetQuality(val int)` from 0 to 4
|
||||
- `Route() int`
|
||||
- `SetRoute(val int)` from 0 to 8
|
||||
- `On() bool`
|
||||
- `SetOn(val bool)`
|
||||
- `Name() string`
|
||||
- `SetName(val string)`
|
||||
- `Ip() string`
|
||||
- `SetIp(val string)`
|
||||
- `Port() int`
|
||||
- `SetPort(val int)` from 1024 to 65535
|
||||
- `Sr() int`
|
||||
- `SetSr(val int)` (11025, 16000, 22050, 24000, 32000, 44100, 48000, 64000, 88200, 96000)
|
||||
- `Channel() int`
|
||||
- `SetChannel(val int)` from 1 to 8
|
||||
- `Bit() int`
|
||||
- `SetBit(val int)` 16 or 24
|
||||
- `Quality() int`
|
||||
- `SetQuality(val int)` from 0 to 4
|
||||
- `Route() int`
|
||||
- `SetRoute(val int)` from 0 to 8
|
||||
|
||||
example:
|
||||
|
||||
@@ -505,10 +505,10 @@ vm.Vban.OutStream[3].SetBit(24)
|
||||
|
||||
The following methods are available
|
||||
|
||||
- `Ins()`
|
||||
- `Outs()`
|
||||
- `Input(val int)`
|
||||
- `Output(val int)`
|
||||
- `Ins()`
|
||||
- `Outs()`
|
||||
- `Input(val int)`
|
||||
- `Output(val int)`
|
||||
|
||||
example:
|
||||
|
||||
@@ -522,13 +522,13 @@ for i := 0; i < int(vm.Device.Ins()); i++ {
|
||||
|
||||
The following methods are available
|
||||
|
||||
- `Play()`
|
||||
- `Stop()`
|
||||
- `Pause()`
|
||||
- `Replay()`
|
||||
- `Record()`
|
||||
- `Ff()`
|
||||
- `Rew()`
|
||||
- `Play()`
|
||||
- `Stop()`
|
||||
- `Pause()`
|
||||
- `Replay()`
|
||||
- `Record()`
|
||||
- `Ff()`
|
||||
- `Rew()`
|
||||
|
||||
example:
|
||||
|
||||
@@ -547,9 +547,9 @@ vm.Recorder.SetB2(false)
|
||||
|
||||
The following methods are available
|
||||
|
||||
- `Channel()` returns the current midi channel
|
||||
- `Current()` returns the most recently pressed midi button
|
||||
- `Get(<button>)` returns the value in cache for the midi button
|
||||
- `Channel()` returns the current midi channel
|
||||
- `Current()` returns the most recently pressed midi button
|
||||
- `Get(<button>)` returns the value in cache for the midi button
|
||||
|
||||
example:
|
||||
|
||||
@@ -562,10 +562,10 @@ var val = vm.Midi.Get(current)
|
||||
|
||||
By default level updates are disabled. Any event may be enabled or disabled. The following events exist:
|
||||
|
||||
- `pdirty` parameter updates
|
||||
- `mdirty` macrobutton updates
|
||||
- `midi` midi updates
|
||||
- `ldirty` level updates
|
||||
- `pdirty` parameter updates
|
||||
- `mdirty` macrobutton updates
|
||||
- `midi` midi updates
|
||||
- `ldirty` level updates
|
||||
|
||||
example:
|
||||
|
||||
@@ -587,4 +587,4 @@ go test ./...
|
||||
|
||||
### 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/main/VoicemeeterRemoteAPI.pdf)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
module main
|
||||
module hotkeys
|
||||
|
||||
go 1.19
|
||||
|
||||
require (
|
||||
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
|
||||
)
|
||||
|
||||
|
||||
@@ -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/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 v1.10.1 h1:kpPN/cTYe1JG2aLUD+/m/bMUbp7wXrqrk1fL+sV8yko=
|
||||
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 h1:AXem+OMeKDuJd2KoLpzHEU70Rx2057p4XKgiOJkXCIo=
|
||||
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/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0=
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
module main
|
||||
module obs
|
||||
|
||||
go 1.18
|
||||
|
||||
require (
|
||||
github.com/BurntSushi/toml v1.2.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
|
||||
)
|
||||
|
||||
|
||||
@@ -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/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 v1.10.1 h1:kpPN/cTYe1JG2aLUD+/m/bMUbp7wXrqrk1fL+sV8yko=
|
||||
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 h1:AXem+OMeKDuJd2KoLpzHEU70Rx2057p4XKgiOJkXCIo=
|
||||
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/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
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)}
|
||||
}
|
||||
|
||||
// OnUpdate satisfies the observer interface defined in publisher.go
|
||||
// for each event type an action is triggered when the event occurs.
|
||||
// Listen registers the observer channel and listens for updates.
|
||||
func (o observer) Listen() {
|
||||
o.vm.Register(o.events)
|
||||
|
||||
@@ -47,13 +46,14 @@ func init() {
|
||||
log.SetLevel(log.InfoLevel)
|
||||
}
|
||||
|
||||
// runObserver initiates a single observer and
|
||||
// starts its Listen() function in a goroutine.
|
||||
func runObserver(vm *voicemeeter.Remote) {
|
||||
o := newObserver(vm)
|
||||
go o.Listen()
|
||||
}
|
||||
|
||||
// main connects to Voiceemeter, registers observer for updates
|
||||
// runs updates for 30 seconds and then deregisters observer.
|
||||
// main connects to Voiceemeter and runs a single observer for 30 seconds.
|
||||
func main() {
|
||||
vm, err := vmConnect()
|
||||
if err != nil {
|
||||
@@ -67,6 +67,7 @@ func main() {
|
||||
}
|
||||
|
||||
// vmConnect connects to Voicemeeter potato and logs into the API
|
||||
// it also add ldirty to event updates.
|
||||
func vmConnect() (*voicemeeter.Remote, error) {
|
||||
vm, err := voicemeeter.NewRemote("basic", 0)
|
||||
if err != nil {
|
||||
|
||||
10
recorder.go
10
recorder.go
@@ -51,3 +51,13 @@ func (r *recorder) Rew() {
|
||||
func (r *recorder) Loop(val bool) {
|
||||
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