diff --git a/soundoutput.py b/soundoutput.py index c19df4e..3b30ea1 100644 --- a/soundoutput.py +++ b/soundoutput.py @@ -70,6 +70,9 @@ def send_audio(self): self.pcm = self.pcm[samples:] self.lock.release() + if len(to_encode) != samples: # pad to_encode if needed to match sample length + to_encode += '\x00'*(samples-len(to_encode)) + encoded = self.encoder.encode(to_encode) audio_encoded += self.encoder_framesize