Don't play empty audio segments

This commit is contained in:
Mark Qvist 2024-06-29 17:32:37 +02:00
parent 7d107ce33d
commit f3f72b3022

View File

@ -1612,7 +1612,11 @@ class SidebandApp(MDApp):
temp_path = None temp_path = None
if self.last_msg_audio != audio_field[1]: if self.last_msg_audio != audio_field[1]:
RNS.log("Reloading audio source", RNS.LOG_DEBUG) RNS.log("Reloading audio source", RNS.LOG_DEBUG)
if len(audio_field[1]) > 10:
self.last_msg_audio = audio_field[1] self.last_msg_audio = audio_field[1]
else:
self.last_msg_audio = None
return
if audio_field[0] == LXMF.AM_OPUS_OGG: if audio_field[0] == LXMF.AM_OPUS_OGG:
temp_path = self.sideband.rec_cache+"/msg.ogg" temp_path = self.sideband.rec_cache+"/msg.ogg"