A REST API for controlling Voicemeeter parameters. This API allows you to control input strips and output buses, including their gain levels and mute states.
- Voicemeeter Potato installed and running
- Go 1.24 or later
- Clone the repository:
git clone https://github.com/nfacha/voicemeeter-rest-api.git
cd voicemeeter-rest-api
- Install dependencies:
go mod tidy
- Run the server:
go run main.go
The server will start on port 4260.
GET /api/strips/{id}
Response:
{
"gain": 0.0,
"mute": false
}
PUT /api/strips/{id}/gain
Request body:
{
"gain": -6.0
}
PUT /api/strips/{id}/mute
Request body:
{
"mute": true
}
PUT /api/strips/{id}/mute/toggle
Response:
{
"gain": 0.0,
"mute": true
}
GET /api/bus/{id}
Response:
{
"gain": 0.0,
"mute": false
}
PUT /api/bus/{id}/gain
Request body:
{
"gain": -6.0
}
PUT /api/bus/{id}/mute
Request body:
{
"mute": true
}
PUT /api/bus/{id}/mute/toggle
Response:
{
"gain": 0.0,
"mute": true
}
- Strip IDs range from 0 to 4 (5 input channels)
- Bus IDs range from 0 to 7 (8 output channels)
- Gain values are in decibels (dB)
- All endpoints return JSON responses
- Error responses include an error message and appropriate HTTP status code
Get strip 0 state:
curl http://localhost:4260/api/strips/0
Set strip 1 gain to -6dB:
curl -X PUT http://localhost:4260/api/strips/1/gain -H "Content-Type: application/json" -d '{"gain": -6.0}'
Toggle strip 2 mute:
curl -X PUT http://localhost:4260/api/strips/2/mute/toggle
Get bus 3 state:
curl http://localhost:4260/api/bus/3
Set bus 4 mute:
curl -X PUT http://localhost:4260/api/bus/4/mute -H "Content-Type: application/json" -d '{"mute": true}'
Toggle bus 5 mute:
curl -X PUT http://localhost:4260/api/bus/5/mute/toggle
The API returns appropriate HTTP status codes and error messages in JSON format:
{
"error": "Strip ID out of range (valid range: 0-4)"
}
Common error codes:
- 400: Bad Request (invalid input)
- 500: Internal Server Error