diff --git a/config.py b/config.py index a8ee9c777badf65e1385b44dd265a1e57df81843..c0d924e84e19437754805b6a8f40e30e09a4011b 100644 --- a/config.py +++ b/config.py @@ -1,6 +1,8 @@ debug = True filesExtension = ".wav" -blankPauseDuration = 0.1 +blankPauseDuration = 0 +musicMinIntroDelay = 10 +musicMaxIntroDelay = 20 introFolder = "intro" # Regex @@ -9,4 +11,10 @@ monoSoloPattern = "((mono)|(MONO))_((solo)|(SOLO))" generalPattern = "(general)|(GENERAL_([0-9]){2})" musicPatten = "^(?:(?!(" + idPattern + "|" + monoSoloPattern + "|" + generalPattern + "|(.*([A-Z])_([0-9]){2})|intro|to|time)).)+$" -musicIntro = "REPLACEMEWITHMSUICTITLE_([0-9]){2}" \ No newline at end of file +musicIntro = "REPLACEMEWITHMSUICTITLE_([0-9]){2}" + +# Radio specific +musicPatterns = ["ID, GENERAL, (MUSIC, INTRO)", "ID, (MUSIC, INTRO)", "GENERAL, (MUSIC, INTRO)", + "ID, GENERAL, (MUSIC, INTRO)"] + +adsAndNewsPatterns = ["AD, AD, NEWS", "NEWS", "MONO_SOLO, AD", "AD, MONO_SOLO", "MONO_SOLO, NEWS", "NEWS, MONO_SOLO"] diff --git a/radio.py b/radio.py index e8d76a13ccbb9f3ad28d7b8924c753cf6e2aa278..30bdef475d4b28de866b63c66595194cc7032c29 100644 --- a/radio.py +++ b/radio.py @@ -23,9 +23,9 @@ class Radio: self.musics = defs.getFilesByRegex(self.filesPath, config.musicPatten) def play(self): - for id in self.ids: - defs.playSound(id) - defs.playSound(random.choice(self.monoSolos)) + while True: + defs.playSound(random.choice(self.ids)) + defs.playSound(random.choice(self.generals)) music = random.choice(self.musics) # Get all after last / and before last . @@ -33,7 +33,8 @@ class Radio: print("Playing: " + musicName) defs.playSound(random.choice(defs.getMusicIntroFiles(self.filesPath, musicName))) defs.playSound(music) - defs.playSound(random.choice(self.generals)) + defs.playSound(random.choice(self.monoSolos)) + radiosStations = ["non-stop-pop"] chosenRadio = random.choice(radiosStations)