Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Python-GTAV-Radios
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sofiane Lasri
Python-GTAV-Radios
Commits
852c8959
Commit
852c8959
authored
2 years ago
by
Sofiane Lasri
Browse files
Options
Downloads
Patches
Plain Diff
On peut désormais régler le volume par défaut, config d'exemple.
parent
ff439941
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitignore
+2
-1
2 additions, 1 deletion
.gitignore
defs.py
+3
-1
3 additions, 1 deletion
defs.py
example.config.py
+2
-1
2 additions, 1 deletion
example.config.py
radio.py
+1
-2
1 addition, 2 deletions
radio.py
with
8 additions
and
5 deletions
.gitignore
+
2
−
1
View file @
852c8959
.idea
config.py
\ No newline at end of file
This diff is collapsed.
Click to expand it.
defs.py
+
3
−
1
View file @
852c8959
...
...
@@ -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
()
...
...
This diff is collapsed.
Click to expand it.
config.py
→
example.
config.py
+
2
−
1
View file @
852c8959
debug
=
Tru
e
debug
=
Fals
e
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}
"
...
...
This diff is collapsed.
Click to expand it.
radio.py
+
1
−
2
View file @
852c8959
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment