def reload_music_file(self):
with file_lock:
try:
+ if self.filename.startswith("/"):
+ filename = self.filename
+ else:
+ filename = Config.music_path + self.filename
+
debug_print("Reloading « {} »".format(self.name))
initial_db_gain = gain(self.initial_volume_factor * 100)
self.audio_segment = pydub.AudioSegment \
- .from_file(Config.music_path + self.filename) \
+ .from_file(filename) \
.set_frame_rate(Config.frame_rate) \
.set_channels(Config.channels) \
.set_sample_width(Config.sample_width) \
def on_enter_loading(self):
with file_lock:
try:
+ if self.filename.startswith("/"):
+ filename = self.filename
+ else:
+ filename = Config.music_path + self.filename
+
debug_print("Loading « {} »".format(self.name))
self.mixer = self.mapping.mixer or Mixer()
initial_db_gain = gain(self.initial_volume_factor * 100)
self.audio_segment = pydub.AudioSegment \
- .from_file(Config.music_path + self.filename) \
+ .from_file(filename) \
.set_frame_rate(Config.frame_rate) \
.set_channels(Config.channels) \
.set_sample_width(Config.sample_width) \