Skip to content
Snippets Groups Projects
Commit 852c8959 authored by Sofiane Lasri's avatar Sofiane Lasri
Browse files

On peut désormais régler le volume par défaut, config d'exemple.

parent ff439941
Branches
No related tags found
No related merge requests found
.idea
config.py
\ No newline at end of file
......@@ -28,6 +28,7 @@ def playSound(soundFile):
# We will play the sound file
player = vlc.MediaPlayer(soundFile)
player.audio_set_volume(config.volume)
player.play()
# We will wait for the sound to finish
......@@ -69,6 +70,7 @@ def playSoundWithDelayedSecondSound(firstSound, secondSound):
players[1].set_media(instances[1].media_new(secondSound))
# We will play the first sound
players[0].audio_set_volume(config.volume)
players[0].play()
# We wait
......@@ -91,7 +93,7 @@ def playSoundWithDelayedSecondSound(firstSound, secondSound):
print("Done playing Intro: " + secondSound)
# We will now raise the volume of the first sound
players[0].audio_set_volume(100)
players[0].audio_set_volume(config.volume)
# We will wait for the first sound to finish
current_state = players[0].get_state()
......
debug = True
debug = False
filesExtension = ".wav"
blankPauseDuration = 0
musicMinIntroDelay = 5
......@@ -6,6 +6,7 @@ musicMaxIntroDelay = 15
introFolder = "intro"
adsProbability = 0.25
newsProbability = 0.25
volume = 75
# Regex
idPattern = "((id)|(ID))_([0-9]){2}"
......
......@@ -30,7 +30,6 @@ class Radio:
self.ads = defs.getFilesByRegex(self.adsPath, ".*")
self.news = defs.getFilesByRegex(self.newsPath, ".*")
def startRadio(self):
while True:
# Check if we will play an ad or news
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment