# HG changeset patch # User Thibaut Girka # Date 1340047000 -7200 # Node ID c412df42aa15ca5ce161d45ec5d3868e7a5dcc6b # Parent 2fcdb89669571687bdf79a2c87b04ff87cbc961d Fix music looping diff --git a/pytouhou/ui/music.py b/pytouhou/ui/music.py --- a/pytouhou/ui/music.py +++ b/pytouhou/ui/music.py @@ -31,13 +31,13 @@ class InfiniteWaveSource(WaveSource): def _get_audio_data(self, bytes): - if bytes % self.audio_format.bytes_per_sample != 0: - bytes -= bytes % self.audio_format.bytes_per_sample + bytes -= bytes % self.audio_format.bytes_per_sample + data = b'' length = bytes while True: size = min(length, self._end - self._offset) - data = self._file.read(size) + data += self._file.read(size) if size == length: break