default="config.yml",
required=False,
help="Config file to load")
+ parser.add_argument("-p", "--music-path",
+ default=".",
+ required=False,
+ help="Folder in which to find the music files")
parser.add_argument("-d", "--debug",
nargs=0,
action=DebugModeAction,
Config.channels = args.channels
Config.sample_width = args.sample_width
Config.builtin_mixing = args.builtin_mixing
+ if args.music_path.endswith("/"):
+ Config.music_path = args.music_path
+ else:
+ Config.music_path = args.music_path + "/"
class DebugModeAction(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
debug_print("Reloading « {} »".format(self.name))
initial_db_gain = gain(self.initial_volume_factor * 100)
self.audio_segment = pydub.AudioSegment \
- .from_file(self.filename) \
+ .from_file(Config.music_path + self.filename) \
.set_frame_rate(Config.frame_rate) \
.set_channels(Config.channels) \
.set_sample_width(Config.sample_width) \
self.mixer = self.mapping.mixer or Mixer()
initial_db_gain = gain(self.initial_volume_factor * 100)
self.audio_segment = pydub.AudioSegment \
- .from_file(self.filename) \
+ .from_file(Config.music_path + self.filename) \
.set_frame_rate(Config.frame_rate) \
.set_channels(Config.channels) \
.set_sample_width(Config.sample_width) \