[![Go Reference](https://pkg.go.dev/badge/github.com/onyx-and-iris/voicemeeter.svg)](https://pkg.go.dev/github.com/onyx-and-iris/voicemeeter) # A Go Wrapper for Voicemeeter API This package offers a Go interface for the Voicemeeter Remote C API. For an outline of past/future changes refer to: [CHANGELOG](CHANGELOG.md) ## Tested against - Basic 1.0.8.4 - Banana 2.0.6.4 - Potato 3.0.2.4 ## Requirements - [Voicemeeter](https://voicemeeter.com/) - Go 1.18 or greater ## Installation Initialize your own module then `go get` ``` go mod init github.com/x/y go get github.com/onyx-and-iris/voicemeeter ``` ## `Use` #### `main.go` ```go package main import ( "fmt" "log" "github.com/onyx-and-iris/voicemeeter" ) func main() { vm, err := vmConnect() if err != nil { log.Fatal(err) } defer vm.Logout() vm.Strip[0].SetLabel("rode podmic") vm.Strip[0].SetMute(true) fmt.Printf("Strip 0 (%s) mute was set to %v\n", vm.Strip[0].GetLabel(), vm.Strip[0].GetMute()) } func vmConnect() (*voicemeeter.Remote, error) { vm, err := voicemeeter.NewRemote("banana", 20) if err != nil { return nil, err } err = vm.Login() if err != nil { return nil, err } return vm, nil } ``` ## `voicemeeter.NewRemote(, )` ### `kindId` Pass the kind of Voicemeeter as an argument. kindId may be: - `basic` - `banana` - `potato` ### `delay` Pass a delay in milliseconds to force the getters to wait for dirty parameters to clear. Useful if not running callbacks. ## `Remote Type` #### `vm.Strip` []t_strip slice containing both physicalStrip and virtualStrip types #### `vm.Bus` []t_bus slice containing both physicalBus and virtualBus types #### `vm.Button` []button slice containing button types, one for each macrobutton #### `vm.Command` pointer to command type, represents action type functions #### `vm.Vban` pointer to vban type, containing both vbanInStream and vbanOutStream slices #### `vm.Device` pointer to device type, represents physical input/output hardware devices #### `vm.Recorder` pointer to recorder type, represents the recorder #### `vm.Midi` pointer to midi type, represents a connected midi device #### `vm.Type()` returns the type of Voicemeeter as a string #### `vm.Version()` returns the version of Voicemeeter as a string #### `vm.GetFloat()` gets a float parameter value #### `vm.SetFloat(, )` sets a float parameter value eg. vm.SetFloat("strip[0].mute", 1) #### `vm.GetString()` gets a string parameter value #### `vm.SetString(, )` sets a string parameter value eg. vm.SetString("strip[0].label", "podmic") #### `vm.SendText(