25 lines
550 B
Python
25 lines
550 B
Python
import subprocess
|
|
|
|
SOUNDS = {
|
|
"alarm": {
|
|
"file_path": "/usr/share/sounds/freedesktop/stereo/alarm-clock-elapsed.oga",
|
|
"volume": "50%",
|
|
},
|
|
"notif": {"file_path": "utils/assets/error-08-206492.mp3", "volume": "85%"},
|
|
}
|
|
|
|
|
|
def play_alarm_sound(file_path, volume):
|
|
subprocess.run(
|
|
[
|
|
"amixer",
|
|
"-D",
|
|
"pulse",
|
|
"sset",
|
|
"Master",
|
|
volume,
|
|
],
|
|
capture_output=True,
|
|
)
|
|
subprocess.run(["paplay", file_path], capture_output=True)
|