feat: mumble instead of parole

This commit is contained in:
2026-04-13 11:55:13 +02:00
parent 19ab152729
commit 1dde89169e
3 changed files with 14 additions and 11 deletions

View File

@@ -10,16 +10,24 @@ OP_PING = 'PING'.encode()
OP_OK = 'OK'.encode()
OP_ERROR = 'ERROR'.encode()
def exec_mumble(deaf: bool):
subprocess.Popen(['mumble', 'rpc', 'deaf' if deaf else 'undeaf'])
def deaf_mumble():
exec_mumble(true)
def undeaf_mumble():
exec_mumble(false)
class CallManager:
def __init__(self, config):
self.config = config
self.state = NO_CALL
self.station = None
self.call_process = None
def call(self, station):
try:
self.call_process = subprocess.Popen(['parole', '-c', station['host'], '-d', self.config['audio device']])
undeaf_mumble()
s = socket.socket()
print('host=', station['host'])
print('port=', station['port'])
@@ -34,10 +42,9 @@ class CallManager:
except Exception as e:
print('Error al realizar la llamada: ', e)
station['green'].off()
self.call_process.terminate()
self.call_process.communicate()
def incoming_call(self, station):
undeaf_mumble()
self.state = INCOMING_CALL
self.station = station
station['red'].on()
@@ -46,9 +53,7 @@ class CallManager:
print('Hang! self.station', self.station)
if self.station is not None:
self.station['red'].off()
if self.call_process is not None:
self.call_process.terminate()
self.call_process.communicate()
deaf_mumble()
self.state = NO_CALL
self.station = None