diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2016-06-21 10:50:59 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2016-06-21 10:50:59 +0200 |
commit | 425dd061bf64a8304ec96aec870b0e2e24fa44f4 (patch) | |
tree | a9d71c92501b9933c68fbac30c28694ec71b95a7 | |
parent | d05b1117dfb842959f89797174718ab58d04dd77 (diff) | |
download | MusicSampler-425dd061bf64a8304ec96aec870b0e2e24fa44f4.tar.gz MusicSampler-425dd061bf64a8304ec96aec870b0e2e24fa44f4.tar.zst MusicSampler-425dd061bf64a8304ec96aec870b0e2e24fa44f4.zip |
Fix frame rate when importing music
-rw-r--r-- | helpers/music_file.py | 2 |
1 files changed, 1 insertions, 1 deletions
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: | |||
17 | def load_sound(self, lock): | 17 | def load_sound(self, lock): |
18 | lock.acquire() | 18 | lock.acquire() |
19 | print("Loading « {} »".format(self.name)) | 19 | print("Loading « {} »".format(self.name)) |
20 | self.raw_data = pydub.AudioSegment.from_file(self.filename).raw_data | 20 | self.raw_data = pydub.AudioSegment.from_file(self.filename).set_frame_rate(44100).raw_data |
21 | self.sound = pygame.mixer.Sound(self.raw_data) | 21 | self.sound = pygame.mixer.Sound(self.raw_data) |
22 | print("Loaded « {} »".format(self.name)) | 22 | print("Loaded « {} »".format(self.name)) |
23 | self.loaded = True | 23 | self.loaded = True |