changeset 324:c412df42aa15

Fix music looping
author Thibaut Girka <thib@sitedethib.com>
date Mon, 18 Jun 2012 21:16:40 +0200
parents 2fcdb8966957
children cddfd3cb4797
files pytouhou/ui/music.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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