X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=helpers%2Fmusic_file.py;h=cdc9836c19a299b82b2ba2fcca17495ea5f53cd9;hb=425dd061bf64a8304ec96aec870b0e2e24fa44f4;hp=d40a13262c51dc78657ea351b0833b43326a530f;hpb=d05b1117dfb842959f89797174718ab58d04dd77;p=perso%2FImmae%2FProjets%2FPython%2FMusicSampler.git 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