From: Ismaël Bouya Date: Tue, 21 Jun 2016 08:50:59 +0000 (+0200) Subject: Fix frame rate when importing music X-Git-Tag: 1.0.0~87 X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FProjets%2FPython%2FMusicSampler.git;a=commitdiff_plain;h=425dd061bf64a8304ec96aec870b0e2e24fa44f4 Fix frame rate when importing music --- diff --git a/helpers/music_file.py b/helpers/music_file.py index d40a132..cdc9836 100644 --- a/helpers/music_file.py +++ b/helpers/music_file.py @@ -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