Browse Source

phschoen: add volume override per artist

Thomas B 8 months ago
parent
commit
bce005f09b
1 changed files with 14 additions and 1 deletions
  1. 14
    1
      osci-pi.py

+ 14
- 1
osci-pi.py View File

@@ -57,14 +57,26 @@ bat = None
57 57
 songlist = None
58 58
 currentfile = None
59 59
 lasttime = None
60
+currvol = basevol
61
+
62
+vol_list = [
63
+    ("Harley_Matthews", "100"),
64
+]
65
+
60 66
 
61 67
 basedir = sys.argv[1]
62 68
 if basedir.endswith("/"):
63 69
     basedir = basedir.removesuffix("/")
64 70
 
65 71
 def get_artist(fn):
72
+    global currvol
66 73
     parts = fn.replace(basedir + "/", "").split(os.sep)
67 74
     artist = parts[0].replace("_", " ")
75
+    currvol = basevol
76
+    for i in vol_list:
77
+        if i[0] in fn:
78
+            currvol = i[1]
79
+            break
68 80
     return artist
69 81
 
70 82
 #originalsongs = os.listdir(basedir)
@@ -159,7 +171,8 @@ def play(filename):
159 171
     currentfile = filename
160 172
     status(currentfile)
161 173
 
162
-    currentplaying = subprocess.Popen(["ffplay", "-hide_banner", "-nostats", "-nodisp", "-autoexit", "-volume", basevol, filename])
174
+    print("volume %s " %  currvol)
175
+    currentplaying = subprocess.Popen(["ffplay", "-hide_banner", "-nostats", "-nodisp", "-autoexit", "-volume", currvol, filename])
163 176
 
164 177
 def running():
165 178
     global currentplaying

Loading…
Cancel
Save