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 .idea
config.py
\ No newline at end of file
...@@ -28,6 +28,7 @@ def playSound(soundFile): ...@@ -28,6 +28,7 @@ def playSound(soundFile):
# We will play the sound file # We will play the sound file
player = vlc.MediaPlayer(soundFile) player = vlc.MediaPlayer(soundFile)
player.audio_set_volume(config.volume)
player.play() player.play()
# We will wait for the sound to finish # We will wait for the sound to finish
...@@ -69,6 +70,7 @@ def playSoundWithDelayedSecondSound(firstSound, secondSound): ...@@ -69,6 +70,7 @@ def playSoundWithDelayedSecondSound(firstSound, secondSound):
players[1].set_media(instances[1].media_new(secondSound)) players[1].set_media(instances[1].media_new(secondSound))
# We will play the first sound # We will play the first sound
players[0].audio_set_volume(config.volume)
players[0].play() players[0].play()
# We wait # We wait
...@@ -91,7 +93,7 @@ def playSoundWithDelayedSecondSound(firstSound, secondSound): ...@@ -91,7 +93,7 @@ def playSoundWithDelayedSecondSound(firstSound, secondSound):
print("Done playing Intro: " + secondSound) print("Done playing Intro: " + secondSound)
# We will now raise the volume of the first sound # 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 # We will wait for the first sound to finish
current_state = players[0].get_state() current_state = players[0].get_state()
......
debug = True debug = False
filesExtension = ".wav" filesExtension = ".wav"
blankPauseDuration = 0 blankPauseDuration = 0
musicMinIntroDelay = 5 musicMinIntroDelay = 5
...@@ -6,6 +6,7 @@ musicMaxIntroDelay = 15 ...@@ -6,6 +6,7 @@ musicMaxIntroDelay = 15
introFolder = "intro" introFolder = "intro"
adsProbability = 0.25 adsProbability = 0.25
newsProbability = 0.25 newsProbability = 0.25
volume = 75
# Regex # Regex
idPattern = "((id)|(ID))_([0-9]){2}" idPattern = "((id)|(ID))_([0-9]){2}"
......
...@@ -30,7 +30,6 @@ class Radio: ...@@ -30,7 +30,6 @@ class Radio:
self.ads = defs.getFilesByRegex(self.adsPath, ".*") self.ads = defs.getFilesByRegex(self.adsPath, ".*")
self.news = defs.getFilesByRegex(self.newsPath, ".*") self.news = defs.getFilesByRegex(self.newsPath, ".*")
def startRadio(self): def startRadio(self):
while True: while True:
# Check if we will play an ad or news # 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