]> git.immae.eu Git - perso/Immae/Projets/Python/MusicSampler.git/commitdiff
Fix fade_out
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Fri, 24 Jun 2016 12:26:44 +0000 (14:26 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Fri, 24 Jun 2016 12:26:44 +0000 (14:26 +0200)
helpers/action.py
helpers/music_file.py

index 1cb168650c765301039a48132f34eb2684119c26..42a08d0b875136ab4459abf4ea9ea239a496227d 100644 (file)
@@ -69,7 +69,7 @@ class Action:
             music.stop(fade_out = fade_out)
         else:
             if fade_out > 0:
-                pygame.fadeout(fade_out * 1000)
+                pygame.fadeout(int(fade_out * 1000))
             else:
                 pygame.mixer.stop()
 
index 10784596a38db66cbde3594aab0adcac3b2231fb..667c16905859c97d997ee2fc0d54b25c22f10805 100644 (file)
@@ -42,7 +42,7 @@ class MusicFile:
         else:
             sound = pygame.mixer.Sound(self.raw_data)
 
-        self.channel().play(sound, fade_ms = fade_in * 1000)
+        self.channel().play(sound, fade_ms = int(fade_in * 1000))
         self.flag_paused = False
 
     def pause(self):
@@ -55,7 +55,7 @@ class MusicFile:
 
     def stop(self, fade_out = 0):
         if fade_out > 0:
-            self.channel().fadeout(fade_out * 1000)
+            self.channel().fadeout(int(fade_out * 1000))
         else:
             self.channel().stop()