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

View File

@@ -102,9 +102,7 @@ for _station in stations:
try:
while True:
for _station in stations:
# new_input_state = GPIO.input(_station['button'])
new_input_state = _station['btn'].is_pressed
# print('new_input_state ', new_input_state)
# Al pulsar el interruptor cambia el estado.
elapsed_time = time.clock_gettime(time.CLOCK_MONOTONIC) - _station['button state changed time']
if new_input_state != _station['old button state'] and elapsed_time > 0.2:

View File

@@ -1,9 +1,9 @@
[Unit]
Description=Parole
Description=Mumble
After=network.target
[Service]
ExecStart=/usr/bin/parole -la -d plughw:1,0
ExecStart=xvfb-run mumble mumble://uli@miki
WorkingDirectory=/home/pi
StandardOutput=inherit
StandardError=inherit