mirror of
https://github.com/onyx-and-iris/voicemeeter.git
synced 2024-11-22 04:40:53 +00:00
refactor example in readme
This commit is contained in:
parent
1284c92680
commit
21fb2ad597
21
README.md
21
README.md
@ -42,12 +42,7 @@ import (
|
||||
)
|
||||
|
||||
func main() {
|
||||
vm, err := voicemeeter.NewRemote("banana", 15)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
err = vm.Login()
|
||||
vm, err := vmConnect()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@ -57,6 +52,20 @@ func main() {
|
||||
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", 15)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = vm.Login()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return vm, nil
|
||||
}
|
||||
```
|
||||
|
||||
## `voicemeeter.NewRemote(<kindId>, <delay>)`
|
||||
|
Loading…
Reference in New Issue
Block a user