]> git.immae.eu Git - perso/Immae/Projets/Python/MusicSampler.git/blobdiff - helpers/music_file.py
Fix frame rate when importing music
[perso/Immae/Projets/Python/MusicSampler.git] / helpers / music_file.py
index d40a13262c51dc78657ea351b0833b43326a530f..cdc9836c19a299b82b2ba2fcca17495ea5f53cd9 100644 (file)
@@ -17,7 +17,7 @@ class MusicFile:
     def load_sound(self, lock):
         lock.acquire()
         print("Loading « {} »".format(self.name))
-        self.raw_data = pydub.AudioSegment.from_file(self.filename).raw_data
+        self.raw_data = pydub.AudioSegment.from_file(self.filename).set_frame_rate(44100).raw_data
         self.sound = pygame.mixer.Sound(self.raw_data)
         print("Loaded « {} »".format(self.name))
         self.loaded = True