disable unptt outside of voice mode

This commit is contained in:
birb 2025-04-13 21:23:59 -05:00
parent cc27080e27
commit e02bcfc464
No known key found for this signature in database
GPG Key ID: BFB779869FEE99D2

View File

@ -356,7 +356,8 @@ rtAudio.openStream(
"freeremote",
(pcm) => {
const encoded = opusEncoder.encodeFloat(pcm, frameSize);
if (currentSocket && !state.transmitting) currentSocket.emit("audio", encoded);
if (currentSocket && !state.transmitting)
currentSocket.emit("audio", encoded);
}
);
@ -521,6 +522,11 @@ io.on("connection", (socket) => {
socket.emit("error", "PTT is already disengaged.");
socket.emit("state", state);
return;
} else if (state.mode !== "voice") {
socket.emit(
"error",
"You cannot use the PTT command outside of voice mode."
);
}
if (socket.pttTimeout) clearTimeout(socket.pttTimeout);
await asyncRpc(flrigClient, "rig.set_ptt", [0]);