AutoPTT uses a Protobuf-based IPC over TCP, which by default is at address 127.1.2.3:4000. You can change it in the General settings tab.
Each IPC message encoded in delimited Protobuf, meaning that a varint containing the length of the message always precedes the actual message.
autoptt.proto contains the details (look for the message Ipc section).
Connecting
- The client connects to the server by opening a TCP socket.
- After accepting the connection, the server sends an
IpcServerHellomessage, which contains theipc_versionfield. The client should check that the value is the same as it was when the client was implemented. If that is not the case, there are no guarantees that IPC will work correctly. - The client sends a
IpcClientConfiguremessage, where it can setcurrent_value_update_rate_msto a non-zero value to start receiving updates on the current value of the microphone. It's disabled by default. The client should also set theipc_versionandipc_tagfields, the latter of which should describe your app -- kind of likeUser-Agentin HTTP.
The server will also send some other messages right after, such as IpcActivityStateChanged, IpcMuteStateChanged, IpcSettingsChanged and IpcAppEnabledStateChanged. And as the names suggest, these messages will be sent each time values they refer to change, so you should definitely track them. Especially IpcAppEnabledStateChanged because when its value changes to false, it means all app functionality is stopped.
You can find a full example on how the this interface is used in the autoptt-streamdeck repository.